| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | 6 | public function validate($input): bool |
|
| 29 | { |
||
| 30 | // for array |
||
| 31 | 6 | if (is_array($input)) { |
|
| 32 | 4 | return in_array($this->containsValue, $input, true); |
|
| 33 | } |
||
| 34 | // for string |
||
| 35 | 2 | if (is_string($input)) { |
|
|
|
|||
| 36 | 2 | return false !== mb_strpos($input, $this->containsValue, 0, mb_detect_encoding($input)); |
|
| 37 | } |
||
| 38 | return false; |
||
| 39 | } |
||
| 41 |