TomasVotruba / bladestan

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

Add basic support for components and livewire attribute validation #98

Closed robchett closed 5 months ago

robchett commented 5 months ago

This adds support for checking the data passed into the components so phpstan can analyze the attributes. This fixes previously undetected issues like:

 <x-some-component :undefinedVar :b="$undefinedVar" c="{{ $undefinedVar }}"></x-some-component>

It does NOT verify any of the attributes match the requirement of the component

Regexes and surrounding code for parsing the tags has been taken from the Blade & Livewire projects.

robchett commented 5 months ago

Sure can, tests now added.

robchett commented 5 months ago

Fixed the CI issues.

TomasVotruba commented 5 months ago

Thank you :clap: