| Total Complexity | 2 | 
| Total Lines | 16 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 7 | class ValidNameDaysWeek implements Rule | ||
| 8 | { | ||
| 9 | /** | ||
| 10 | * Check day is valid. | ||
| 11 | */ | ||
| 12 | public function passes($attribute, $value): bool | ||
| 13 |     { | ||
| 14 |         return preg_match('/^(?:sun(?:day)?|mon(?:day)?|tue(?:sday)?|wed(?:nesday)?|thu(?:rsday)?|fri(?:day)?|sat(?:urday)?)$/i', $value); | ||
|  | |||
| 15 | } | ||
| 16 | |||
| 17 | /** | ||
| 18 | * Get the validation error message. | ||
| 19 | */ | ||
| 20 | public function message(): string | ||
| 23 | } | ||
| 24 | } | ||
| 25 |