bladestan icon indicating copy to clipboard operation
bladestan copied to clipboard

Prevent PHPStan from caching any file that calls view()

Open AJenbo opened this issue 1 year ago • 3 comments

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.

AJenbo avatar Oct 02 '23 02:10 AJenbo

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)

staabm avatar Oct 02 '23 14:10 staabm

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

johnbacon avatar Apr 29 '24 20:04 johnbacon

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

AJenbo avatar Apr 29 '24 20:04 AJenbo