Simplify MD_STD::startsWithAny

This commit is contained in:
jrenslin committed 2022-01-16 15:19:40 +01:00
1 parent c689f7568f
commit 2a333c1de6
1 file changed
+3 -5
+3 -5
View File
@@ -163,14 +163,12 @@ public static function startsWith(string $haystack, string $needle):bool {
*/
public static function startsWithAny(string $haystack, array $needles):bool {
$output = false;
foreach ($needles as $needle) {
$output = \str_starts_with($haystack, $needle);
if ($output == true) {
return $output;
if (\str_starts_with($haystack, $needle) === true) {
return true;
}
}
return $output;
return false;
}