Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5.2742 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8030 | 8 | public static function str_starts_with_any(string $str, array $substrings): bool |
|
8031 | { |
||
8032 | 8 | if ($str === '') { |
|
8033 | return false; |
||
8034 | } |
||
8035 | |||
8036 | 8 | if ($substrings === []) { |
|
8037 | return false; |
||
8038 | } |
||
8039 | |||
8040 | 8 | foreach ($substrings as &$substring) { |
|
8041 | 8 | if (self::str_starts_with($str, (string) $substring)) { |
|
8042 | 2 | return true; |
|
8043 | } |
||
8044 | } |
||
8045 | |||
8046 | 6 | return false; |
|
8047 | } |
||
13706 |