Skip to content

Caching edge case when there is missing symbol #4495

@tomasfejfar

Description

@tomasfejfar

Bug report

PHPStan - PHP Static Analysis Tool 0.12.65 (not the latest, but close I guess)

When there is missing symbol, the cache is not invalidated when the symbol appears elsewhere.

Code snippet that reproduces the problem

(ain't that simple)

  • let there be a class MyClass, that uses Guzzle and contains RequestOptions::ALLOW_REDIRECTS somewhere in the code
  • you checkout the branch containing the above code and run phpstan
  • cache is saved with ~ Access to undefined constant RequestOptions::ALLOW_REDIRECTS. in the file MyClass.php
  • you notice that this is caused by missing library and run composer install

Expected output

  • now that the symbol is known, there is no error

Actual output

  • the cache remains in place (I assume that because the file with the error has not changed) and the violation is reported again
  • you need to find out that the cache is the culprit and remove it

Is this expected behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions