| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public static function validateInputOnCreateUser($input) |
||
| 20 | { |
||
| 21 | if (!isset($input['name'])) { |
||
| 22 | throw new UserException(UserException::USER_NAME_REQUIRED, 400); |
||
| 23 | } |
||
| 24 | $name = self::validateName($input['name']); |
||
| 25 | $email = null; |
||
| 26 | if (isset($input['email'])) { |
||
| 27 | $email = self::validateEmail($input['email']); |
||
| 28 | } |
||
| 29 | |||
| 30 | return ['name' => $name, 'email' => $email]; |
||
| 31 | } |
||
| 32 | |||
| 53 |