TomasVotruba / bladestan

PHPStan analysis for Blade templates

Home Page:https://tomasvotruba.com/blog/introducing-bladestan-phpstan-analysis-of-blade-templates/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

View variables are not recognized if stored in a variable

AJenbo opened this issue · comments

The following will fail

$items = ['item'];
$compat = compact('items');
return view('newsletters.edit-new-segmented', $compat);

But this will pass

$items = ['item'];
return view('newsletters.edit-new-segmented', compact('items'));

@TomasVotruba I expect to start adding test cases next week, so no need to mention it again :)

I'm unable to replicate this error, so I guess it was solved already.

Thank you

Hope you saw #49 as well, it's the last fix I need before i can continue on to level 1 😅

Once that is done I will work on getting our other project working with Bladestan. That one is running level 4 and the following blade files:

Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Blade                          358           1644             70          13584