| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function validate($input): bool |
||
| 43 | { |
||
| 44 | if (is_array($this->haystack)) { |
||
| 45 | return in_array($input, $this->haystack, false); |
||
| 46 | } |
||
| 47 | |||
| 48 | if (!is_string($this->haystack)) { |
||
| 49 | return false; |
||
| 50 | } |
||
| 51 | |||
| 52 | if (empty($input)) { |
||
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 56 | $enc = mb_detect_encoding($input); |
||
| 57 | |||
| 58 | return mb_stripos($this->haystack, $input, 0, $enc) !== false; |
||
| 59 | } |
||
| 60 | |||
| 76 |