Bug report
i have a legacy project with duplicated class definitions for legacy tests and i just moved to a new laptop and triggered errors due to that, which i did not have before.
so after investigating i can confirm that i have two files which are the culprit and lead to errors with phpstan i do not have on my old laptop.
the nature of the error is phpstan using the classes defined in the global namespace from the testhelpers instead of the correct ones.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: lib/symfony-one/test/unit/helper/DateHelperTest.php
deleted: lib/symfony-one/test/unit/sfContextMock.class.php
the autoloading looks like this:
"classmap": [
"lib",
],
"exclude-from-classmap": [
"lib/symfony-one/test"
],
]
the phpstan config looks like this:
paths:
- src
- tests
excludePaths:
analyse:
[...]
analyseAndScan:
[...]
a workaround would be to either delete the files or exclude them specifically via
excludePaths:
analyseAndScan:
- lib/symfony-one/test
i cant pinpoint the reason why this works on my old machine but not on my new machine anymore, then again, colleagues reported a simmilar issue in the past, which i was unable to track down - but i expect it could be similar in nature.
Code snippet that reproduces the problem
No response
Expected output
no errors :)
Did PHPStan help you today? Did it make you happy in any way?
a nice way to see the performance improvements of my new laptop 😁
Bug report
i have a legacy project with duplicated class definitions for legacy tests and i just moved to a new laptop and triggered errors due to that, which i did not have before.
so after investigating i can confirm that i have two files which are the culprit and lead to errors with phpstan i do not have on my old laptop.
the nature of the error is phpstan using the classes defined in the global namespace from the testhelpers instead of the correct ones.
the autoloading looks like this:
the phpstan config looks like this:
a workaround would be to either delete the files or exclude them specifically via
i cant pinpoint the reason why this works on my old machine but not on my new machine anymore, then again, colleagues reported a simmilar issue in the past, which i was unable to track down - but i expect it could be similar in nature.
Code snippet that reproduces the problem
No response
Expected output
no errors :)
Did PHPStan help you today? Did it make you happy in any way?
a nice way to see the performance improvements of my new laptop 😁