Simplify MD_STD::startsWithAny
This commit is contained in:
parent
c689f7568f
commit
2a333c1de6
@ -163,14 +163,12 @@ final class MD_STD {
|
|||||||
*/
|
*/
|
||||||
public static function startsWithAny(string $haystack, array $needles):bool {
|
public static function startsWithAny(string $haystack, array $needles):bool {
|
||||||
|
|
||||||
$output = false;
|
|
||||||
foreach ($needles as $needle) {
|
foreach ($needles as $needle) {
|
||||||
$output = \str_starts_with($haystack, $needle);
|
if (\str_starts_with($haystack, $needle) === true) {
|
||||||
if ($output == true) {
|
return true;
|
||||||
return $output;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $output;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user