| Conditions | 5 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public static function values(): array |
||
| 34 | { |
||
| 35 | $reflection = new \ReflectionClass(__CLASS__); |
||
| 36 | $methods = $reflection->getMethods(\ReflectionMethod::IS_STATIC); |
||
| 37 | $arr = []; |
||
| 38 | |||
| 39 | foreach ($methods as $method) { |
||
| 40 | if ($method->getName() !== "values" && $method->getName() !== "forName" && $method->getName() !== "resources") { |
||
| 41 | $arr[] = $method->invoke(null); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | return $arr; |
||
| 45 | } |
||
| 47 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: