Menu

← Back to phpstan.*

Error Identifier: phpstan.path

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 #

This error does not correspond to a specific PHP code pattern. It is emitted when PHPStan is configured to analyse a path that does not exist or is a directory instead of a file.

Why is it reported? #

PHPStan was given a file path to analyse, but the path either does not exist on the filesystem or points to a directory instead of a file. PHPStan can only analyse PHP files, not directories or missing paths.

This error is not ignorable because PHPStan cannot analyse a file that does not exist.

How to fix it #

Check the paths configuration in phpstan.neon and make sure all listed paths point to existing files or directories:

 # phpstan.neon
 parameters:
     paths:
-        - src/OldModule
+        - src/NewModule

If files have been moved or renamed, update the configuration to reflect the current file structure.

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\FileAnalyser [1] [2]

Edit this page on GitHub

Theme
A
© 2026 PHPStan s.r.o.