-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Fix non-detected private typed properties in PHP 7.4 #875
Conversation
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.
Please add the name of the sniff to the commit message, see eg. commits in master.
And please rebase also to master.
Thanks.
build.xml
Outdated
@@ -22,15 +22,33 @@ | |||
</target> | |||
|
|||
<target name="lint"> | |||
<exec |
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.
This is useless, please remove.
@@ -231,4 +232,18 @@ public function testClassWithWriteOnlyProperties(): void | |||
} | |||
} | |||
|
|||
public function testClassWithTypedProperties(): void | |||
{ | |||
if (PHP_VERSION_ID < 70400) { |
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.
All tests should work on all versions, please remove.
class ClassWithTypedProperties | ||
{ | ||
|
||
private self $self; |
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.
It looks there is indetation with spaces, please change to tabs.
@@ -0,0 +1,24 @@ | |||
<?php |
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.
Change to <?php // lint >= 7.4
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.
Got it for everything but my comment on unused variable.
I knew there should be a better way to handle 7.4 vs 7.3 😃 Thanks !
4d14fb3
to
3f9fae4
Compare
Private typed properties are not detected, thus sniffs likes WriteOnly do not detect them.
I had to handle php7.4 vs php7.3 in the build script to exclude php7.4 specific files from
lint
target.