Conditions | 5 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | 3 | public function has(...$toCompare): bool |
|
39 | { |
||
40 | 3 | $smallerSources = array_slice($this->sources, 0, min(count($this->sources), count($toCompare))); |
|
41 | 3 | foreach ($smallerSources as $i => $source) { |
|
42 | /** @var ABan $source */ |
||
43 | 3 | if (is_string($toCompare[$i]) && !empty($toCompare[$i])) { |
|
44 | 3 | $source->setLookedFor($toCompare[$i]); |
|
45 | 3 | if ($source->isBanned()) { |
|
46 | 2 | return true; |
|
47 | } |
||
48 | } |
||
49 | } |
||
50 | 1 | return false; |
|
51 | } |
||
53 |