| Total Complexity | 5 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 83.33% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class Ip implements RuleValidateInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var array Rule properties |
||
| 22 | */ |
||
| 23 | public static $config = [ |
||
| 24 | 'class' => 'Ip', |
||
| 25 | 'full_class' => __CLASS__, |
||
| 26 | 'alias' => ['ip'], |
||
| 27 | 'args_count' => 0, |
||
| 28 | 'args_type' => [], |
||
| 29 | 'has_validate' => true |
||
| 30 | ]; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var string Error message |
||
| 34 | */ |
||
| 35 | private $message = ''; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Validate. |
||
| 39 | * |
||
| 40 | * @return bool |
||
| 41 | */ |
||
| 42 | 12 | public function validate(): bool |
|
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Concrete validate. |
||
| 51 | * |
||
| 52 | * @param string $received |
||
| 53 | * |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | 12 | private function concreteValidate(string $received): bool |
|
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Return error message. |
||
| 72 | * |
||
| 73 | * @return string Error message |
||
| 74 | */ |
||
| 75 | public function getMessage(): string |
||
| 80 |