Skip to content

Commit

Permalink
Merge branch 'feature/test-frame-bugfix-warnings-not-counted' of http…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Sep 9, 2020
2 parents 69a28ec + fac9db0 commit bf61e98
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Standards/AbstractSniffUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,17 @@ public function generateFailureMessages(LocalFile $file)
$warningsTemp = [];
foreach ($warnings as $warning) {
$warningsTemp[] = $warning['message'].' ('.$warning['source'].')';

$source = $warning['source'];
if (in_array($source, $GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'], true) === false) {
$GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'][] = $source;
}

if ($warning['fixable'] === true
&& in_array($source, $GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'], true) === false
) {
$GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'][] = $source;
}
}

$allProblems[$line]['found_warnings'] = array_merge($foundWarningsTemp, $warningsTemp);
Expand Down

0 comments on commit bf61e98

Please sign in to comment.