Skip to content

Commit 11c3c03

Browse files
committed
refactor: getValues returns only values
1 parent f9d19af commit 11c3c03

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Common/AbstractEnum.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ final public function is(self $other): bool
195195
*
196196
* @since n.e.x.t
197197
*
198-
* @return array<string, string> Map of constant names to values.
198+
* @return string[] List of all enum values.
199199
*/
200200
final public static function getValues(): array
201201
{
202-
return self::getConstants();
202+
return array_values(self::getConstants());
203203
}
204204

205205
/**

tests/unit/Common/AbstractEnumTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,7 @@ public function testGetValuesReturnsAllValidValues(): void
173173
{
174174
$values = ValidTestEnum::getValues();
175175

176-
$this->assertSame([
177-
'FIRST_NAME' => 'first',
178-
'LAST_NAME' => 'last',
179-
], $values);
176+
$this->assertSame(['first', 'last'], $values);
180177
}
181178

182179
/**

0 commit comments

Comments
 (0)