diff --git a/src/Analyser/Analyser.php b/src/Analyser/Analyser.php index 6941c4a0d6..cd91c8a3a0 100644 --- a/src/Analyser/Analyser.php +++ b/src/Analyser/Analyser.php @@ -131,6 +131,10 @@ private function collectErrors(array $analysedFiles): void return true; } + if ($errno === E_DEPRECATED) { + return true; + } + if (!in_array($errfile, $analysedFiles, true)) { return true; } diff --git a/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php b/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php index f4256db031..6a414bec53 100644 --- a/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Methods/ExistingClassesInTypehintsRuleTest.php @@ -205,20 +205,7 @@ public function dataRequiredParameterAfterOptional(): array return [ [ 70400, - PHP_VERSION_ID < 80000 || self::$useStaticReflectionProvider ? [] : [ - [ - 'Required parameter $bar follows optional parameter $foo', - 8, - ], - [ - 'Required parameter $bar follows optional parameter $foo', - 17, - ], - [ - 'Required parameter $bar follows optional parameter $foo', - 21, - ], - ], + [], ], [ 80000,