Ejemplo n.º 1
0
$review->addReview($codeSniffer);
// Review the staged files.
$review->files($git->getStagedFiles());
// output any errors or warnings
if ($reporter->hasIssues()) {
    $climate->out('')->out('');
    foreach ($reporter->getIssues() as $issue) {
        switch ($issue->getColour()) {
            case 'red':
                $climate->red($issue);
                break;
            case 'cyan':
                $climate->cyan($issue);
                break;
            case 'brown':
                $climate->yellow($issue);
                break;
            default:
                $climate->white($issue);
                break;
        }
    }
}
// Check if any matching issues were found.
if ($reporter->hasErrors()) {
    $climate->out('')->red('✘ Please fix the errors above.');
    exit(1);
} else {
    $climate->out('')->green('✔ No errors. Code looks good.')->white('Have you tested everything?');
    exit(0);
}