| Conditions | 4 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 364 | public static function EnsureArgumentIsArray($maybe, int $argument = null, string $method = __METHOD__) : array |
|
| 21 | { |
||
| 22 | 364 | if ( ! is_array($maybe)) { |
|
| 23 | 2 | throw new InvalidArgumentException( |
|
| 24 | 'Argument ' . |
||
| 25 | 2 | (is_int($argument) ? $argument : self::INDEX_FIRST_ARG) . |
|
| 26 | 2 | ' passed to ' . |
|
| 27 | 2 | $method . |
|
| 28 | 2 | ' must be an array, ' . |
|
| 29 | 2 | (is_object($maybe) ? get_class($maybe) : gettype($maybe)) . |
|
| 30 | 2 | ' given!' |
|
| 31 | ); |
||
| 32 | } |
||
| 33 | |||
| 34 | 362 | return $maybe; |
|
| 35 | } |
||
| 98 |