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

Fix non-detected private typed properties in PHP 7.4 #875

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

paxal
Copy link
Contributor

@paxal paxal commented Jan 28, 2020

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.

Copy link
Contributor

@kukulich kukulich left a 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
Copy link
Contributor

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) {
Copy link
Contributor

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;
Copy link
Contributor

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
Copy link
Contributor

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

@kukulich kukulich added the Bug label Jan 28, 2020
Copy link
Contributor Author

@paxal paxal left a 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 !

@kukulich kukulich merged commit 53369b7 into slevomat:master Jan 28, 2020
@paxal paxal deleted the unused-private-php74 branch January 29, 2020 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants