diff --git a/src/Files/File.php b/src/Files/File.php index 03ed0c14aa..984de785bd 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -879,6 +879,7 @@ protected function addMessage($error, $message, $line, $column, $code, $data, $s // Filter out any messages for sniffs that shouldn't have run // due to the use of the --sniffs command line argument. if ($includeAll === false + && $parts[0] !== 'Internal' && ((empty($this->configCache['sniffs']) === false && in_array(strtolower($listenerCode), $this->configCache['sniffs'], true) === false) || (empty($this->configCache['exclude']) === false diff --git a/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.php b/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.php index f3e8cfd537..7cc77f7bdc 100644 --- a/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/BacktickOperatorUnitTest.php @@ -43,8 +43,10 @@ public function getErrorList() */ public function getWarningList() { - // Warning about incorrect annotation will be shown on line 1 once PR #3915 would be merged. - return []; + return [ + // Warning about incorrect annotation. + 1 => 1, + ]; }//end getWarningList() diff --git a/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php b/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php index be242c781d..cef051b481 100644 --- a/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/DisallowAlternativePHPTagsUnitTest.php @@ -56,7 +56,15 @@ public function getErrorList($testFile='') public function getWarningList($testFile='') { if ($testFile === 'DisallowAlternativePHPTagsUnitTest.2.inc') { + // Check if the Internal.NoCodeFound error can be expected on line 1. + $option = (bool) ini_get('short_open_tag'); + $line1 = 1; + if ($option === true) { + $line1 = 0; + } + return [ + 1 => $line1, 2 => 1, 3 => 1, 4 => 1, diff --git a/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php b/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php index 3edda9a567..625122984d 100644 --- a/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.php @@ -88,7 +88,14 @@ public function getWarningList($testFile='') case 'DisallowShortOpenTagUnitTest.1.inc': return []; case 'DisallowShortOpenTagUnitTest.3.inc': + // Check if the Internal.NoCodeFound error can be expected on line 1. + $option = (bool) ini_get('short_open_tag'); + $line1 = 1; + if ($option === true) { + $line1 = 0; + } return [ + 1 => $line1, 3 => 1, 6 => 1, 11 => 1,