-
-
Notifications
You must be signed in to change notification settings - Fork 47
Adds appliesTo to verify if a given rule should be applied #454
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #454 +/- ##
============================================
+ Coverage 93.62% 94.79% +1.16%
- Complexity 593 606 +13
============================================
Files 69 69
Lines 1601 1614 +13
============================================
+ Hits 1499 1530 +31
+ Misses 102 84 -18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I don't think this would be the expected behaviour from our users.... |
| $this->classDescriptionBuilder | ||
| ->addDependency(new ClassDependency(implode('\\', $nodeName->getParts()), $node->getLine())); | ||
| } | ||
| } |
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 snippet was adding the dependency derived by attributes twice
|
|
||
| /** | ||
| * @requires PHP >= 8.0 | ||
| */ |
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.
removed because even if we are on php 7.4 php parser can parse php 8 code.
|
|
||
| public function appliesTo(ClassDescription $theClass): bool | ||
| { | ||
| return !($theClass->isInterface() || $theClass->isTrait() || $theClass->isEnum() || $theClass->isFinal()); |
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 isFinal should not be there?
This is a tentative fix for #434. It introduces a new method, appliesTo, which is used to decide if a given rules should be applied to the class under examination, eg:
Caveat: with this fix a rule defined in that way
would miss any final class present in the namesapce
App\Abstract. Is that what we want?