| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 17 | protected function matched(): array |
|
| 26 | { |
||
| 27 | // compare string with array of all banned strings |
||
| 28 | 17 | $s = mb_strtolower($this->searchKey); |
|
| 29 | 17 | $foundRecords = []; |
|
| 30 | 17 | foreach ($this->source->getRecords() as $index => $word) { |
|
| 31 | 17 | $found = mb_strpos($s, mb_strtolower($word)); |
|
| 32 | 17 | if (false !== $found) { |
|
| 33 | 6 | $foundRecords[$index] = intval($found); |
|
| 34 | } |
||
| 35 | } |
||
| 36 | 17 | return $foundRecords; |
|
| 37 | } |
||
| 39 |