File tree Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ trait Names
99 /** Get an array of case names. */
1010 public static function names (): array
1111 {
12- return array_map (function ($ case ) {
13- return $ case ->name ;
14- }, static ::cases ());
12+ return array_column (static ::cases (), 'name ' );
1513 }
1614}
Original file line number Diff line number Diff line change @@ -9,10 +9,6 @@ trait Options
99 /** Get an associative array of [case name => case value]. */
1010 public static function options (): array
1111 {
12- return array_reduce (static ::cases (), function ($ options , $ case ) {
13- $ options [$ case ->name ] = $ case ->value ;
14-
15- return $ options ;
16- }, []);
12+ return array_column (static ::cases (), 'value ' , 'name ' );
1713 }
1814}
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ trait Values
99 /** Get an array of case values. */
1010 public static function values (): array
1111 {
12- return array_map (function ($ case ) {
13- return $ case ->value ;
14- }, static ::cases ());
12+ return array_column (static ::cases (), 'value ' );
1513 }
1614}
You can’t perform that action at this time.
0 commit comments