Every error reported by PHPStan has an error identifier. Here’s a list of all error identifiers. In PHPStan Pro you can see the error identifier next to each error and filter errors by their identifiers.
Code example #
# phpstan.neon
parameters:
ignoreErrors:
-
message: '#Call to undefined method Foo::bar\(\)#'
path: src/MyClass.php
Why is it reported? #
An ignored error pattern in your PHPStan configuration was not matched by any actual error during analysis. This means the pattern is no longer needed, either because the underlying code has been fixed or the error no longer occurs. Keeping stale ignore patterns can hide new, unrelated errors that happen to match the pattern.
How to fix it #
Remove the unmatched ignore pattern from your configuration:
# phpstan.neon
parameters:
ignoreErrors:
- -
- message: '#Call to undefined method Foo::bar\(\)#'
- path: src/MyClass.php
If you want to keep the pattern temporarily, you can disable reporting of unmatched errors by setting reportUnmatched: false on the specific entry:
parameters:
ignoreErrors:
-
message: '#Call to undefined method Foo::bar\(\)#'
path: src/MyClass.php
reportUnmatched: false
Non-ignorable error #
This error cannot be ignored using @phpstan-ignore or the ignoreErrors configuration. Non-ignorable errors indicate code that would cause a crash or a fatal error at runtime, or a fundamental problem in the analysed code that must be addressed.
Rules that report this error #
- PHPStan\Analyser\Ignore\IgnoredErrorHelperResult [1]