| Conditions | 6 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 4 | private static function isArrayOfReference($element, bool $all = true): bool |
|
| 23 | { |
||
| 24 | 4 | if (false === is_array($element)) { |
|
| 25 | 4 | return false; |
|
| 26 | } |
||
| 27 | |||
| 28 | 3 | if (true === empty($element)) { |
|
| 29 | 2 | return false; |
|
| 30 | } |
||
| 31 | |||
| 32 | 3 | return array_reduce( |
|
| 33 | 3 | $element, |
|
| 34 | static function ($valid, $item) use ($all): bool { |
||
| 35 | 3 | $isReference = static::isReference($item); |
|
| 36 | 3 | if (true === $all) { |
|
| 37 | 3 | return true === $valid && true === $isReference; |
|
| 38 | } |
||
| 39 | |||
| 40 | 3 | return true === $valid || true === $isReference; |
|
| 41 | 3 | }, |
|
| 42 | $all |
||
| 43 | ); |
||
| 46 |