| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ZenkakuKatakana implements Rule |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $configs; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Create a new rule instance. |
||
| 16 | * |
||
| 17 | * @param array $configs |
||
| 18 | * @return void |
||
| 19 | */ |
||
| 20 | public function __construct(array $configs = []) |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Determine if the validation rule passes. |
||
| 29 | * |
||
| 30 | * @param string $attribute |
||
| 31 | * @param mixed $value |
||
| 32 | * @return bool |
||
| 33 | */ |
||
| 34 | public function passes($attribute, $value) |
||
| 35 | { |
||
| 36 | return (bool)preg_match('/^(\xe3(\x82[\xa1-\xbf]|\x83[\x80-\xb6]|\x83\xbc))*$/', $value); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the validation error message. |
||
| 41 | * |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | public function message() |
||
| 47 | } |
||
| 48 | } |
||
| 49 |