Error Identifier: ignore.unmatched
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
How to ignore this error #
You can use the identifier ignore.unmatched to ignore this error using a comment:
// @phpstan-ignore ignore.unmatched
codeThatProducesTheError();
You can also use only the identifier key to ignore all errors of the same type in your configuration file in the ignoreErrors parameter:
parameters:
ignoreErrors:
-
identifier: ignore.unmatched
Rules that report this error #
- PHPStan\Analyser\Ignore\IgnoredErrorHelperResult [1]