| Total Complexity | 5 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 8 | class RegistrationValidator |
||
| 9 | { |
||
| 10 | public static function basicRules() |
||
|
1 ignored issue
–
show
|
|||
| 11 | { |
||
| 12 | return [ |
||
| 13 | 'name' => 'required|string|max:255', |
||
| 14 | 'email' => 'required|string|email|max:255|unique:users', |
||
| 15 | 'password' => [ |
||
| 16 | 'required', |
||
| 17 | 'min:8', |
||
| 18 | new PasswordFormatRule, |
||
| 19 | 'confirmed' |
||
| 20 | ], |
||
| 21 | ]; |
||
| 22 | } |
||
| 23 | |||
| 24 | public static function managerRegistrationExtraRules() |
||
|
1 ignored issue
–
show
|
|||
| 25 | { |
||
| 26 | return [ |
||
| 27 | 'department' => 'required|integer', |
||
| 28 | 'gov_email' => 'nullable|required_unless:department,0|string|email|unique:users', // gov_email is required unless department is set to 0 (Not in Goverment) |
||
|
1 ignored issue
–
show
|
|||
| 29 | ]; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Get a validator for an incoming registration request. |
||
| 34 | * |
||
| 35 | * @param array $data Incoming registration data. |
||
| 36 | * @return \Illuminate\Contracts\Validation\Validator |
||
| 37 | */ |
||
| 38 | public static function userValidator(array $data) |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get a validator for an incoming Manager registration request. |
||
| 45 | * |
||
| 46 | * @param array $data Incoming registration data. |
||
| 47 | * @return \Illuminate\Contracts\Validation\Validator |
||
| 48 | */ |
||
| 49 | public static function managerValidator(array $data) |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Get a validator for an incoming finishManagerRegistration request. |
||
| 57 | * |
||
| 58 | * @param array $data Incoming registration data. |
||
| 59 | * @return \Illuminate\Contracts\Validation\Validator |
||
| 60 | */ |
||
| 61 | public static function finalizeManagerValidator(array $data) |
||
| 66 |