From 21990ccd8bc152c288c8b71067035629fb9471c1 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 7 Dec 2022 14:17:30 +0000 Subject: [PATCH] refacto: attribute `above` --- src/Factories/Attributes/Attribute.php | 4 +--- src/Factories/Attributes/Covers.php | 4 +--- src/Factories/TestCaseFactory.php | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Factories/Attributes/Attribute.php b/src/Factories/Attributes/Attribute.php index b875fe36..9bd43de9 100644 --- a/src/Factories/Attributes/Attribute.php +++ b/src/Factories/Attributes/Attribute.php @@ -13,10 +13,8 @@ abstract class Attribute { /** * Determine if the attribute should be placed above the class instead of above the method. - * - * @var bool */ - final public const ABOVE_CLASS = false; + public static bool $above = false; /** * @param array $attributes diff --git a/src/Factories/Attributes/Covers.php b/src/Factories/Attributes/Covers.php index da07b2a1..21d1f857 100644 --- a/src/Factories/Attributes/Covers.php +++ b/src/Factories/Attributes/Covers.php @@ -15,10 +15,8 @@ final class Covers extends Attribute { /** * Determine if the attribute should be placed above the classe instead of above the method. - * - * @var bool */ - public const ABOVE_CLASS = true; + public static bool $above = true; /** * Adds attributes regarding the "covers" feature. diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index 1f466e6e..9a48cd5c 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -165,8 +165,8 @@ final class TestCaseFactory $classFQN .= $className; } - $classAvailableAttributes = array_filter(self::ATTRIBUTES, fn (string $attribute): bool => $attribute::ABOVE_CLASS); - $methodAvailableAttributes = array_filter(self::ATTRIBUTES, fn (string $attribute): bool => ! $attribute::ABOVE_CLASS); + $classAvailableAttributes = array_filter(self::ATTRIBUTES, fn (string $attribute): bool => $attribute::$above); + $methodAvailableAttributes = array_filter(self::ATTRIBUTES, fn (string $attribute): bool => ! $attribute::$above); $classAttributes = [];