You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have installed PHPUnit (and other dev-related tools, including Psalm) as PHAR using Phive to vendor/bin/phpunit. PHPUnit is not required as dev dependency in composer.json, so its classes won't load using autoloader, but will still be available when you run PHPUnit because PHAR will provide them. This will cause Psalm to think classes such as PHPUnit\Framework\TestCase do not exist and fail to analyze.
I tried to provide path to PHAR (vendor/bin/phpunit) in extraFiles option in config, both as file and directory, but this doesn't fix the problem. If I provide path as file, Psalm will load but continue to fail to recognise classes. If I provide path as directory, Psalm will fail to load and say that is not a directory.
Is it possible to provide support for loading extraFiles from PHARs? It would be very useful if you don't want to add too many dev tool dependencies to your project, causing slow installation time and possible dependency conflicts.
The text was updated successfully, but these errors were encountered:
ERROR: MissingFile - bugsnag.phar:4:1 - Cannot find file phar:\bugsnag.phar\autoloader.php to include (see https://psalm.dev/107)
ERROR: UndefinedClass - Class or interface Bugsnag\Client does not exist (see https://psalm.dev/019)
I have installed PHPUnit (and other dev-related tools, including Psalm) as PHAR using Phive to
vendor/bin/phpunit
. PHPUnit is not required as dev dependency incomposer.json
, so its classes won't load using autoloader, but will still be available when you run PHPUnit because PHAR will provide them. This will cause Psalm to think classes such asPHPUnit\Framework\TestCase
do not exist and fail to analyze.I tried to provide path to PHAR (
vendor/bin/phpunit
) inextraFiles
option in config, both asfile
anddirectory
, but this doesn't fix the problem. If I provide path as file, Psalm will load but continue to fail to recognise classes. If I provide path as directory, Psalm will fail to load and say that is not a directory.Is it possible to provide support for loading
extraFiles
from PHARs? It would be very useful if you don't want to add too many dev tool dependencies to your project, causing slow installation time and possible dependency conflicts.The text was updated successfully, but these errors were encountered: