| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 63 | 18 | public static function EnsureArgumentIsString($maybe) : string |
|
| 64 | { |
||
| 65 | 18 | if ( ! is_string($maybe)) { |
|
| 66 | 4 | throw new InvalidArgumentException( |
|
| 67 | 'Argument 1 passed to ' . |
||
| 68 | __METHOD__ . |
||
| 69 | ' must be a string, ' . |
||
| 70 | 4 | (is_object($maybe) ? get_class($maybe) : gettype($maybe)) . |
|
| 71 | 4 | ' given!' |
|
| 72 | ); |
||
| 73 | } |
||
| 74 | |||
| 75 | 14 | return $maybe; |
|
| 76 | } |
||
| 98 |