| Total Complexity | 5 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class Helpers |
||
| 6 | { |
||
| 7 | static public function filter_not_null(array $input) |
||
| 8 | { |
||
| 9 | return array_filter($input, function ($value) { |
||
| 10 | return !is_null($value); |
||
| 11 | }); |
||
| 12 | } |
||
| 13 | |||
| 14 | static public function filter_merge(...$input) |
||
| 17 | } |
||
| 18 | |||
| 19 | static public function prefer_single(array $input) |
||
| 20 | { |
||
| 21 | if (count($input) !== 1) { |
||
| 22 | return $input; |
||
| 23 | } |
||
| 24 | |||
| 25 | return reset($input); |
||
| 26 | } |
||
| 27 | |||
| 28 | static public function merge_and_prefer_single(...$input) |
||
| 31 | } |
||
| 32 | } |
||
| 33 |