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

Reject multi hooked property #1052

Closed

Conversation

ondrejmirtes
Copy link
Contributor

Closes #1050

protected function checkPropertyHooksForMultiProperty(Property $property): void {
if (count($property->props) > 1) {
$this->emitError(new Error(
'Multiple properties cannot share the same hooks', $property->getAttributes()));
Copy link
Owner

Choose a reason for hiding this comment

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

This is marking the entire property as the error location. This should probably use the opening brace of the hooks instead, like the one below. (Or alternatively the name of the second property, not sure which is better.)

@nikic nikic closed this in d20a197 Dec 27, 2024
@ondrejmirtes
Copy link
Contributor Author

Thank you!

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.

Property with multiple props and property hooks should be a parse error
2 participants