arkitect
arkitect copied to clipboard
Fixed "IsAbstract" for interfaces, traits, enums and final classes
Fixed \Arkitect\Expression\ForClasses\IsAbstract because:
- interfaces can not be abstract
- traits can not be abstract
- enums can not be abstract
- final classes can not be abstract
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.19%. Comparing base (
b78ecce) to head (00dd134). Report is 3 commits behind head on main.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #425 +/- ##
=========================================
Coverage 94.19% 94.19%
- Complexity 582 586 +4
=========================================
Files 69 69
Lines 1533 1534 +1
=========================================
+ Hits 1444 1445 +1
Misses 89 89
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @sebastianstucke87 can you please fix red checks?
Note that with this change, IsAbstract will now identify interface, trait, enum and final all as abstract classes.
interfaces can not be abstract
I don't believe a rule is needed for this, because this is something PHP already disallows.
At best, I believe the rule could become...
- if ($theClass->isAbstract() || $theClass->isInterface() || $theClass->isTrait() || $theClass->isEnum()
- || $theClass->isFinal()) {
+ if ($theClass->isAbstract() && !$theClass->isInterface() && !$theClass->isTrait() && !$theClass->isEnum()
+ && !$theClass->isFinal()) {
... but it should be redundant because if ::isAbstract() is true then all other states must be false.