| Total Complexity | 5 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 90.91% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class ContainsRule extends AbstractRule |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string needle for search inside input data (haystack) |
||
| 23 | */ |
||
| 24 | protected $containsValue; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Setup validation rule |
||
| 28 | * |
||
| 29 | * @param mixed $containsValue |
||
| 30 | */ |
||
| 31 | 15 | public function __construct($containsValue) |
|
| 34 | 15 | } |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Check input data |
||
| 38 | * |
||
| 39 | * @param string|array $input |
||
| 40 | * |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | 9 | public function validate($input): bool |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get error template |
||
| 59 | * |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | 10 | public function getDescription(): string |
|
| 67 |