| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 83 | 24 | public static function EnsureArgumentIsObjectOrString($maybe, int $argument, string $method) |
|
| 84 | { |
||
| 85 | 24 | if ( ! is_object($maybe) && ! is_string($maybe)) { |
|
| 86 | 2 | throw new InvalidArgumentException( |
|
| 87 | 'Argument ' . |
||
| 88 | 2 | $argument . |
|
| 89 | 2 | ' passed to ' . |
|
| 90 | 2 | $method . |
|
| 91 | 2 | ' must be an object or a string!' |
|
| 92 | ); |
||
| 93 | } |
||
| 94 | |||
| 95 | 22 | return $maybe; |
|
| 96 | } |
||
| 98 |