TomasVotruba / bladestan

PHPStan analysis for Blade templates
https://tomasvotruba.com/blog/introducing-bladestan-phpstan-analysis-of-blade-templates/
MIT License
280 stars 13 forks source link

Prevent PHPStan from caching any file that calls view() #85

Open AJenbo opened 9 months ago

AJenbo commented 9 months ago

Since PHPStan will skip analyzing a file if it has not changed, we can end up in situations where changed templates are not being analyzed as they are only scanned when something that utilizes them gets scanned.

So to ensure that all changes to templates are scanned we need to always analyze the php files that render blade files.

staabm commented 9 months ago

please provide a code example or at best a repo which shows the problem (since I never used blade and laravel, I need good reproducers to fix the problem at hand)

johnbacon commented 2 months ago

We are experiencing the opposite side of this same problem. Blade templates with errors in them are not being re-scanned after fix, leading to false positives in PHPStan (in our case, during the CI process).

cc: @mattgartz

AJenbo commented 2 months ago

It's the same issue, but normally you would not cache the result when test fail so would only see the other outcome.