Total Complexity | 6 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | abstract class EnumerableConstants |
||
21 | { |
||
22 | /** |
||
23 | * @return array |
||
24 | * |
||
25 | * @throws \ReflectionException |
||
26 | */ |
||
27 | public static function enum() |
||
28 | { |
||
29 | $ref = new \ReflectionClass(new static()); |
||
30 | |||
31 | return $ref->getConstants(); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param mixed $value |
||
36 | * @return mixed |
||
37 | * |
||
38 | * @throws \ReflectionException |
||
39 | */ |
||
40 | public static function constantNameByValue($value) |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | * |
||
54 | * @return mixed|null |
||
55 | * |
||
56 | * @throws \ReflectionException |
||
57 | */ |
||
58 | public static function valueOf($name) |
||
65 |