| @@ 21-28 (lines=8) @@ | ||
| 18 | * @return string |
|
| 19 | * @throws \Exception |
|
| 20 | */ |
|
| 21 | protected static function validateName($name) |
|
| 22 | { |
|
| 23 | if (!v::alnum()->length(2, 100)->validate($name)) { |
|
| 24 | throw new \Exception(UserMessage::USER_NAME_INVALID, 400); |
|
| 25 | } |
|
| 26 | ||
| 27 | return $name; |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Validate and sanitize a email address. |
|
| @@ 54-61 (lines=8) @@ | ||
| 51 | * @return string |
|
| 52 | * @throws \Exception |
|
| 53 | */ |
|
| 54 | protected static function validateTaskName($name) |
|
| 55 | { |
|
| 56 | if (!v::alnum()->length(2, 100)->validate($name)) { |
|
| 57 | throw new \Exception(TaskMessage::TASK_NAME_INVALID, 400); |
|
| 58 | } |
|
| 59 | ||
| 60 | return $name; |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * Validate and sanitize a task status. |
|