Menu

Error Identifier: ignore.unmatchedIdentifier

← 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 #

<?php declare(strict_types = 1);

function add(int $a, int $b): int
{
	return $a + $b; // @phpstan-ignore return.type
}

Why is it reported? #

An @phpstan-ignore comment specifies an error identifier, but no error with that identifier is actually reported on the given line. This means the ignore directive is unnecessary – either the error was already fixed, the code was changed, or the identifier was specified incorrectly.

This error is reported when the reportUnmatchedIgnoredErrors parameter is enabled (which is the default).

How to fix it #

Remove the unnecessary ignore comment if the error no longer occurs:

 <?php declare(strict_types = 1);
 
 function add(int $a, int $b): int
 {
-	return $a + $b; // @phpstan-ignore return.type
+	return $a + $b;
 }

If the error should still be ignored but the identifier is wrong, correct it to match the actual error identifier. You can find the correct identifier by temporarily removing the ignore comment and running PHPStan to see the reported error with its identifier.

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\AnalyserResultFinalizer [1]
Theme
A
© 2026 PHPStan s.r.o.