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:
parent
c733871aaa
commit
54bedefb79
3 changed files with 3 additions and 11 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue