Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 0 |
1 | <?php # -*- coding: utf-8 -*- |
||
51 | 2 | protected function strposa(string $haystack, array $needle, int $offset = 0): bool |
|
52 | 2 | { |
|
53 | |||
54 | 2 | foreach ($needle as $query) { |
|
55 | // If we found the string only on position 0. |
||
56 | 2 | if (strpos($haystack, $query, $offset) === 0) { |
|
57 | return true; |
||
58 | } // stop on first false result |
||
59 | } |
||
60 | |||
61 | 2 | return false; |
|
62 | } |
||
64 |