1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 23:54:05 +00:00

use array_column() to get the names, values, and options (#3)

This commit is contained in:
Eric Junker 2022-02-21 06:32:07 -06:00 committed by GitHub
parent c733871aaa
commit 54bedefb79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 11 deletions

View file

@ -9,8 +9,6 @@ trait Values
/** Get an array of case values. */
public static function values(): array
{
return array_map(function ($case) {
return $case->value;
}, static::cases());
return array_column(static::cases(), 'value');
}
}