| Conditions | 6 |
| Paths | 8 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6.0359 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | { |
||
| 17 | if (is_null($callback)) { |
||
| 18 | if (empty($array)) { |
||
| 19 | return static::value($default); |
||
| 20 | } |
||
| 21 | foreach ($array as $item) { |
||
| 22 | return $item; |
||
| 23 | } |
||
| 24 | } |
||
| 25 | foreach ($array as $key => $value) { |
||
| 26 | if (call_user_func($callback, $value, $key)) { |
||
| 27 | return $value; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | return static::value($default); |
||
| 31 | } |
||
| 32 | |||
| 38 |