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

Type of $this gets mangled when passed as a variable to blade

AJenbo opened this issue · comments

If in a component you use the following to pass the component model to the blade template:

view('my-template', ['model' => $this]);

The analyzed PHP code will looks like this:

/** @var $this(App\View\Components\MyForm) $model */

Thisisn't valid an will generate errors and warnings in PHPStan, instead the correctly generated phpDoc should look like this:

/** @var App\View\Components\MyForm $model */