diff --git a/src/Expression/ForClasses/IsAbstract.php b/src/Expression/ForClasses/IsAbstract.php index 6d16c069..7dc5632e 100644 --- a/src/Expression/ForClasses/IsAbstract.php +++ b/src/Expression/ForClasses/IsAbstract.php @@ -20,7 +20,7 @@ public function describe(ClassDescription $theClass, string $because): Descripti public function appliesTo(ClassDescription $theClass): bool { - return !($theClass->isInterface() || $theClass->isTrait() || $theClass->isEnum() || $theClass->isFinal()); + return !($theClass->isInterface() || $theClass->isTrait() || $theClass->isEnum()); } public function evaluate(ClassDescription $theClass, Violations $violations, string $because): void diff --git a/src/Expression/ForClasses/IsNotAbstract.php b/src/Expression/ForClasses/IsNotAbstract.php index b35eb20f..13537e3f 100644 --- a/src/Expression/ForClasses/IsNotAbstract.php +++ b/src/Expression/ForClasses/IsNotAbstract.php @@ -20,7 +20,7 @@ public function describe(ClassDescription $theClass, string $because): Descripti public function appliesTo(ClassDescription $theClass): bool { - return !($theClass->isInterface() || $theClass->isTrait() || $theClass->isEnum() || $theClass->isFinal()); + return !($theClass->isInterface() || $theClass->isTrait() || $theClass->isEnum()); } public function evaluate(ClassDescription $theClass, Violations $violations, string $because): void diff --git a/tests/Unit/Expressions/ForClasses/IsAbstractTest.php b/tests/Unit/Expressions/ForClasses/IsAbstractTest.php index 4f2de7c7..d1a3af3a 100644 --- a/tests/Unit/Expressions/ForClasses/IsAbstractTest.php +++ b/tests/Unit/Expressions/ForClasses/IsAbstractTest.php @@ -95,7 +95,7 @@ public function test_enums_can_not_be_abstract_and_should_be_ignored(): void self::assertFalse($isNotAbstract->appliesTo($classDescription)); } - public function test_final_classes_can_not_be_abstract_and_should_be_ignored(): void + public function test_final_classes_should_not_be_ignored(): void { $isAbstract = new IsAbstract(); $isNotAbstract = new IsNotAbstract(); @@ -106,7 +106,7 @@ public function test_final_classes_can_not_be_abstract_and_should_be_ignored(): ->setFinal(true) ->build(); - self::assertFalse($isAbstract->appliesTo($classDescription)); - self::assertFalse($isNotAbstract->appliesTo($classDescription)); + self::assertTrue($isAbstract->appliesTo($classDescription)); + self::assertTrue($isNotAbstract->appliesTo($classDescription)); } }