| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 156 | public static function name($name) |
|
| 24 | { |
||
| 25 | 156 | if (!is_string($name)) { |
|
| 26 | 5 | throw new ClientException( |
|
| 27 | 5 | 'Name must be a string', |
|
| 28 | SDK::INVALID_ARGUMENT |
||
| 29 | 5 | ); |
|
| 30 | } |
||
| 31 | |||
| 32 | 151 | if ($name === '') { |
|
| 33 | 5 | throw new ClientException( |
|
| 34 | 5 | 'Name cannot be empty', |
|
| 35 | SDK::INVALID_ARGUMENT |
||
| 36 | 5 | ); |
|
| 37 | } |
||
| 38 | |||
| 39 | 146 | return $name; |
|
| 40 | } |
||
| 68 |