Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
21 | 15 | public static function all() |
|
22 | { |
||
23 | 15 | $reflection = new \ReflectionClass(get_class()); |
|
24 | 15 | $constants = array(); |
|
25 | |||
26 | //search for all constants in this class that start with $prefix |
||
27 | 15 | foreach ($reflection->getConstants() as $constName => $constValue) { |
|
28 | 15 | $constants[$constName] = $constValue; |
|
29 | } |
||
30 | |||
31 | 15 | return $constants; |
|
32 | } |
||
33 | } |
||
34 |