Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What reason it persistently analyzes the vendor dir ? #7990

Closed
atlance opened this issue May 20, 2022 · 1 comment
Closed

What reason it persistently analyzes the vendor dir ? #7990

atlance opened this issue May 20, 2022 · 1 comment

Comments

@atlance
Copy link

atlance commented May 20, 2022

command: vendor/bin/psalm -c psalm.xml --debug-by-line

psalm.xml:

 ...
    <fileExtensions>
        <extension name=".php" />
    </fileExtensions>
    <projectFiles>
        <directory name="src" />
        <ignoreFiles>
            <directory name="vendor" />
            <directory name="tests" />
            <directory name="var/cache" />
        </ignoreFiles>
    </projectFiles>

    <ignoreExceptions>
        <class name="vendor"/>
        <class name="var/cache"/>
    </ignoreExceptions>
 ...

Result:

Getting /app/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AttributeReader.php
Analyzing /app/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AttributeReader.php
/app/vendor/vimeo/psalm/src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1647
/app/vendor/vimeo/psalm/src/Psalm/Internal/Type/SimpleAssertionReconciler.php:1649
Parsing /app/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AttributeReader.php

...

/app/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Statements/Expression/AssertionFinder.php:3440
/app/vendor/friendsofphp/php-cs-fixer/src/Fixer/PhpUnit/PhpUnitConstructFixer.php:108
Uncaught Exception: InvalidArgumentException Could not get class storage for class-string-map
Emitted in /app/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:46
Stack trace in the forked worker:
#0 /app/vendor/vimeo/psalm/src/Psalm/Internal/TypeVisitor/TypeChecker.php(364): Psalm\Internal\Provider\ClassLikeStorageProvider->get('class-string-ma...')

All third party package errors in my terminal ... =(

@orklah
Copy link
Collaborator

orklah commented May 20, 2022

Psalm needs to scan, and sometimes analyse vendors because code in there will have an impact on your own code. For that Psalm need to be able to at least include and parse vendor files.

Here's more details on that: #7289 (comment)

@orklah orklah closed this as completed May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants