Conditions | 5 |
Paths | 5 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 1 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8593 | 19 | public static function str_starts_with_any(string $str, array $substrings): bool |
|
8594 | { |
||
8595 | if ($str === '') { |
||
8596 | return false; |
||
8597 | } |
||
8598 | |||
8599 | if ($substrings === []) { |
||
8600 | return false; |
||
8601 | } |
||
8602 | |||
8603 | foreach ($substrings as &$substring) { |
||
8604 | if (self::str_starts_with($str, $substring)) { |
||
8605 | return true; |
||
8606 | } |
||
8607 | } |
||
8608 | |||
8609 | return false; |
||
8610 | } |
||
14796 |