Skip to content

Recent commit breaks psalm #10132

@vlakarados

Description

@vlakarados

Recently psalm stopped working, throwing

Uncaught Exception: InvalidArgumentException Could not get class storage for spaze\phpstan\rules\disallowed\allowed\allowdirectivesconfig
 Emitted in /.../vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45 
.......

(Psalm dev-master@a4de6d9dc092d77871b6097af42498a192362e9a crashed due to an uncaught Throwable)

It is thrown on dozens of different repositories which have typehints or classes that are not present. In example above PHPAT surely has a problem, but it should not kill psalm, especially as psalm configuration has <ignoreFiles><directory name="../vendor"/>.

More so it's thrown on libraries that have optional dependencies, in my case psalm throws the same error on Monolog for the ElasticSearch code (I don't have elastic search as I don't use it, but it's supported by Monolog):

Uncaught Exception: InvalidArgumentException Could not get class storage for elastic\elasticsearch\response\elasticsearch
Emitted in /home/stelshevsky/work/projects/jefe/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:45

After requiring different psalm versions (./composer.phar require --dev vimeo/psalm:dev-master#a4de6d9dc092d77871b6097af42498a192362e9a --with-d ependencies), seems this commit causes this:
a4de6d9

Any older version does not have this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions