1 | <?php |
||
16 | abstract class AbstractEnum |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected static $cache = []; |
||
22 | |||
23 | /** |
||
24 | * @return array |
||
25 | */ |
||
26 | 136 | public static function toArray() |
|
36 | |||
37 | /** |
||
38 | * @return array|string[] |
||
39 | */ |
||
40 | 16 | public static function getKeys() |
|
44 | |||
45 | /** |
||
46 | * @param mixed $value |
||
47 | * |
||
48 | * @return string |
||
49 | * @throws \InvalidArgumentException |
||
50 | */ |
||
51 | 8 | public static function getKey($value) |
|
57 | |||
58 | /** |
||
59 | * @param string $key |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | 40 | public static function isValidKey($key) |
|
67 | |||
68 | /** |
||
69 | * @param string $key |
||
70 | * |
||
71 | * @throws \InvalidArgumentException |
||
72 | */ |
||
73 | 40 | public static function assertIsValidKey($key) |
|
79 | |||
80 | /** |
||
81 | * @param string $key |
||
82 | * |
||
83 | * @return mixed |
||
84 | * @throws \InvalidArgumentException |
||
85 | */ |
||
86 | 8 | public static function getValue($key) |
|
92 | |||
93 | /** |
||
94 | * @return array |
||
95 | */ |
||
96 | 16 | public static function getValues() |
|
100 | |||
101 | /** |
||
102 | * @param mixed $value |
||
103 | * |
||
104 | * @return bool |
||
105 | */ |
||
106 | 72 | public static function isValidValue($value) |
|
110 | |||
111 | /** |
||
112 | * @throws \InvalidArgumentException |
||
113 | * |
||
114 | * @param mixed $value |
||
115 | */ |
||
116 | 72 | public static function assertIsValidValue($value) |
|
122 | } |
||
123 |