Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for components and livewire attribute validation #98

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

robchett
Copy link
Contributor

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.

Copy link
Contributor

@AJenbo AJenbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work, this is a big step for the tool 👍

Any chance you could add a test for some of this?

@robchett
Copy link
Contributor Author

Sure can, tests now added.

@robchett
Copy link
Contributor Author

Fixed the CI issues.

@TomasVotruba
Copy link
Owner

Thank you 👏

@TomasVotruba TomasVotruba merged commit 391055f into TomasVotruba:main Apr 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants