refacto: attribute above

This commit is contained in:
Nuno Maduro
2022-12-07 14:17:30 +00:00
parent c01654efcc
commit 21990ccd8b
3 changed files with 4 additions and 8 deletions

View File

@ -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<int, string> $attributes

View File

@ -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.

View File

@ -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 = [];