-
Notifications
You must be signed in to change notification settings - Fork 1
[sniffs, property-declaration] Add basic support for property hooks #40
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
base: 2.x
Are you sure you want to change the base?
Conversation
Currently lacking structure inside the hook scope
|
This would resolve #39 |
bix0r
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we need more/better test. What about more complex hooks? Just looking at examples from https://www.php.net/manual/en/language.oop5.property-hooks.php, there are quite a few more cases to consider. Of course we might not want to allow all of them, but then we should have tests related to it.
|
|
||
| private function removeInvalidErrors(File $phpcsFile, int $stackPtr, TokenCollection $tokens): void | ||
| { | ||
| $removeError = function (int $line, int $column): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename $line and $column because you use those variable names in the for loops later. Or just remove them if you don't use them at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out.
The loop shouldn't be there at all actually, as I already know where the error is supposed to be.
|
@dcolt |
Partial work, incomplete
|
Should this be moved from "draft" state? |
No, it's still not complete. |
Currently lacking structure inside the hook scope.