Simplify MD_STD::startsWithAny

This commit is contained in:
Joshua Ramon Enslin 2022-01-16 15:19:40 +01:00
parent c689f7568f
commit 2a333c1de6
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -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;
} }