For reproduce use example repo: https://github.com/liborm85/phpstan-excludepaths-bug with folders/files structure and neon config files and follow the steps below. Where is 1 error in src/thirdparty/ThirdpartyClass.php file and 1 error in src/broken/broken.php file.
Nothing is ignored.
------ --------------------------------------------------------------------
Line broken\broken.php
------ --------------------------------------------------------------------
3 Function brokenfile not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ --------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line thirdparty\ThirdpartyClass.php
------ ----------------------------------------------------------------------
6 Access to an undefined property ThirdpartyClass::$undefinedVariable.
------ ----------------------------------------------------------------------
Folder src/thirdparty is excluded from analyse.
------ --------------------------------------------------------------------
Line broken\broken.php
------ --------------------------------------------------------------------
3 Function brokenfile not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ --------------------------------------------------------------------
Folder src/thirdparty is excluded from analyse.
Folder src/broken is excluded from analyseAndScan.
phpstan2.neon file:
excludePaths:
analyse:
- src/thirdparty
analyseAndScan:
- src/broken
I expect exclude src/thirdparty folder from analyse (only discovering symbols will be performed) and src/broken from analyse and scan completely.
------ ----------------------------------------------------------------------
Line thirdparty\ThirdpartyClass.php
------ ----------------------------------------------------------------------
6 Access to an undefined property ThirdpartyClass::$undefinedVariable.
------ ----------------------------------------------------------------------
[OK] No errors