-
Notifications
You must be signed in to change notification settings - Fork 56
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 attribute sniffs #296
Closed
Closed
Add attribute sniffs #296
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
#[Attribute1] | ||
#[Attribute2] | ||
#[Attribute3] | ||
class TestClass | ||
{ | ||
} | ||
|
||
#[Attribute1] | ||
#[Attribute2] | ||
#[Attribute3] | ||
class TestClass2 | ||
{ | ||
} | ||
|
||
#[Attribute1] | ||
#[Attribute2] | ||
#[Attribute3] | ||
class TestClass3 | ||
{ | ||
} | ||
|
||
/** @internal */ | ||
#[Attribute1] | ||
#[Attribute2] | ||
#[Attribute3] | ||
class TestClass4 | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
#[Attribute1] #[Attribute2] | ||
#[Attribute3] | ||
class TestClass | ||
{ | ||
} | ||
|
||
#[Attribute1,Attribute2] | ||
#[Attribute3] | ||
class TestClass2 | ||
{ | ||
} | ||
|
||
#[Attribute1] | ||
#[Attribute2] | ||
#[Attribute3] | ||
|
||
class TestClass3 | ||
{ | ||
} | ||
|
||
#[Attribute1] | ||
#[Attribute2] | ||
#[Attribute3] | ||
/** @internal */ | ||
class TestClass4 | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wonder why there are so many changes 🤔 something is wrong. Should I clean it up?
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.
Maybe what I did was wrong? How do you usually proceed? What I did was:
phpcs.xml.dist
vendor/bin/phpcs $(find tests/input/* | sort) --report=summary --report-file=tests/expected_report.txt
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.
Depends, I sometimes do it by hand. I have re-applied patches on 11.x branch and there are little changes only.
I guess this must be run on related php version
vendor/bin/phpcs $(find tests/input/* | sort) --report=summary --report-file=tests/expected_report.txt
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.
@simPod I experienced the same issue, this is why I asked for somebody to finish it. Yes, it seems PHP version running the phpcs is relevant. I guess it also installs different versions of composer dependencies, especially for e.g. 7.2
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 believe nobody here likes the patches but that's the best we've got. I'll look into it.
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.
Yes, there are sniffs that are enabled/disabled by detected PHP version - and it’s intentional here.
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 forced the php version in step 3 of my process (otherwise the tests would be red)
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 have opened in as
#297#298 since I cannot push here. We can either merge that (I kept the author) or someone with permissions do some commit shuffling.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.
You mean #298
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.
Yes. I have done +1 but somebody opened a PR meanwhile :D