diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f39710..b8fca8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Enh #22: Add `php-forge/coding-standard` to development dependencies for code quality checks (@terabytesoftw) - Bug #23: Update Rector command in `composer.json` to remove unnecessary 'src' argument (@terabytesoftw) +- Enh #24: Add enums for backed integer, backed string, and unit values in the `Stub` namespace (@terabytesoftw) ## 0.3.1 January 20, 2026 diff --git a/src/ReflectionHelper.php b/src/ReflectionHelper.php index 96f326e..d6f1400 100644 --- a/src/ReflectionHelper.php +++ b/src/ReflectionHelper.php @@ -29,8 +29,6 @@ */ final class ReflectionHelper { - private function __construct() {} - /** * Retrieves a property value from a specified class context. * diff --git a/src/Stub/BackedInteger.php b/src/Stub/BackedInteger.php new file mode 100644 index 0000000..80259b3 --- /dev/null +++ b/src/Stub/BackedInteger.php @@ -0,0 +1,21 @@ + [ - TestEnum::BAR, - 'BAR', - ], - 'FOO element tag' => [ - TestEnum::FOO, - 'FOO', + '1 element tag' => [ + BackedInteger::VALUE, + 1 => '1', ], ], $data, diff --git a/tests/Stub/TestBackedEnum.php b/tests/Stub/TestBackedEnum.php deleted file mode 100644 index ef47685..0000000 --- a/tests/Stub/TestBackedEnum.php +++ /dev/null @@ -1,19 +0,0 @@ - + * @return array */ public static function casesParameters(): array { return [ - 'as enum instance' => [ - TestEnum::class, - 'data-test', - false, - 'enum: FOO', - ' data-test="FOO"', - "Should return the 'data-test' attribute value for enum case: FOO.", + 'enum backed integer instance' => [ + BackedInteger::class, + BackedInteger::VALUE, + true, + 'enum: 1', + ' 1="1"', + "Should return the '1' attribute value for enum case: 1.", ], - 'as html' => [ - TestEnum::class, + 'enum backed string instance' => [ + BackedString::class, 'data-test', true, - 'enum: BAR', - ' data-test="BAR"', - "Should return the 'data-test' attribute value for enum case: BAR.", + 'enum: value', + ' data-test="value"', + "Should return the 'data-test' attribute value for enum case: value.", ], - 'attribute as enum instance' => [ - TestEnum::class, - TestEnum::FOO, - true, - 'enum: FOO', - ' FOO="FOO"', - "Should return the 'FOO' attribute value for enum case: FOO.", + 'enum unit instance' => [ + Unit::class, + 'data-test', + false, + 'enum: value', + ' data-test="value"', + "Should return the 'data-test' attribute value for enum case: value.", ], ]; }