mirror of
https://github.com/pestphp/pest.git
synced 2026-03-12 10:47:25 +01:00
refacto: attribute above
This commit is contained in:
@ -13,10 +13,8 @@ abstract class Attribute
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Determine if the attribute should be placed above the class instead of above the method.
|
* 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
|
* @param array<int, string> $attributes
|
||||||
|
|||||||
@ -15,10 +15,8 @@ final class Covers extends Attribute
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Determine if the attribute should be placed above the classe instead of above the method.
|
* 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.
|
* Adds attributes regarding the "covers" feature.
|
||||||
|
|||||||
@ -165,8 +165,8 @@ final class TestCaseFactory
|
|||||||
$classFQN .= $className;
|
$classFQN .= $className;
|
||||||
}
|
}
|
||||||
|
|
||||||
$classAvailableAttributes = 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_CLASS);
|
$methodAvailableAttributes = array_filter(self::ATTRIBUTES, fn (string $attribute): bool => ! $attribute::$above);
|
||||||
|
|
||||||
$classAttributes = [];
|
$classAttributes = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user