Conversation
Codecov Report
@@ Coverage Diff @@
## main #316 +/- ##
============================================
+ Coverage 93.02% 93.23% +0.20%
- Complexity 476 487 +11
============================================
Files 60 62 +2
Lines 1262 1301 +39
============================================
+ Hits 1174 1213 +39
Misses 88 88
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
AlessandroMinoccheri
left a comment
There was a problem hiding this comment.
I would suggest to add a description of this new behavior into the README file
| } | ||
|
|
||
| public function setRunOnlyThis(): self | ||
| public function negateShoulds(): self |
There was a problem hiding this comment.
Why did you do this change?
| use Arkitect\Rules\ViolationMessage; | ||
| use Arkitect\Rules\Violations; | ||
|
|
||
| class NegateDecorator implements Expression |
There was a problem hiding this comment.
What about naming it just Not? I could also simplify other expressions
| return new AllClasses(); | ||
| } | ||
|
|
||
| public static function noClass(): NoClass |
There was a problem hiding this comment.
what about naming it NoClasses, for consistency with AllClasses?
There was a problem hiding this comment.
Because it would not be correct English. It's the same in Italian "tutte le classi"/"nessuna classe".
There was a problem hiding this comment.
I am far from being an expert but I think also NoClasses is correct. Looking at java's ArchUnit they decided to used it, eg.
ArchRule rule = ArchRuleDefinition.noClasses()
.that().resideInAPackage("..service..")
.should().accessClassesThat().resideInAPackage("..controller..");
rule.check(importedClasses);| { | ||
| if ($this->negateShoulds) { | ||
| $should = new NegateDecorator($should); | ||
| } |
There was a problem hiding this comment.
Maybe I am too low on ☕ but I can't wrap my head around this, would you mind explaining it to me?
If the should method in NoClass already does this
$this->ruleBuilder->addShould(new NegateDecorator($expression));
why do we need to add another new NegateDecorator here?
Closes #315 allowing to write rules like:
or