Error Identifier: ignore.allLineErrors

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

In phpstan.neon:

parameters:
	reportIgnoresWithoutComments: true
<?php

// @phpstan-ignore-next-line
echo $undefined;

echo $anotherUndefined; // @phpstan-ignore-line

Why is it reported? #

When reportIgnoresWithoutComments is enabled, PHPStan disallows @phpstan-ignore-next-line and @phpstan-ignore-line completely. These directives suppress all errors on a line without specifying which error identifiers are being ignored and without requiring an explanation.

This makes it too easy to accidentally suppress unrelated errors that appear on the same line in the future.

How to fix it #

Replace the blanket ignore with @phpstan-ignore using a specific error identifier and a comment explaining why:

-// @phpstan-ignore-next-line
+// @phpstan-ignore variable.undefined (used for legacy compatibility)
 echo $undefined;
-echo $anotherUndefined; // @phpstan-ignore-line
+echo $anotherUndefined; // @phpstan-ignore variable.undefined (loaded dynamically)

Each identifier must have an accompanying comment in parentheses.

Running vendor/bin/phpstan analyse --fix replaces @phpstan-ignore-next-line and @phpstan-ignore-line with @phpstan-ignore listing the identifiers of the errors currently reported on the ignored line. Any text after the original tag becomes the comment for each identifier. If an error on that line has no identifier, the ignore is left for you to rewrite by hand.

Learn more about ignoring errors in Ignoring Errors.

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