Error Identifier: ignore.unmatched

← Back to ignore.*

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.

When the entry has a path, the error is reported in that file. When the entry has no path, the error is reported at the line where the entry is defined in the configuration file.

When only some of the paths from the configuration are passed on the command line (for example vendor/bin/phpstan analyse src/Foo), PHPStan cannot know whether an entry would match in the files that were not analysed. In that case an entry whose path is a directory or a wildcard pattern is reported only when that path is under the analysed paths, and an entry with several paths is reported only with the analysed ones. An entry without a path is not reported at all, because the errors it matches could be anywhere. When there are no paths in the configuration, the paths passed on the command line are taken as the whole project and all entries are reported as usual.

This error is controlled by the reportUnmatchedIgnoredErrors configuration parameter.

How to fix it #

Remove the unmatched ignore pattern from your configuration. This can be done automatically by running PHPStan with --fix, which removes unmatched entries from the configuration files and the baseline, including entries without a path:

 # 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

🔧 This error is auto-fixable. PHPStan can fix it for you. Run the analysis with the --fix option to rewrite the affected code:

vendor/bin/phpstan analyse --fix

Learn more about --fix »

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] [2]
Theme
© 2026 PHPStan s.r.o.