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 {
$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;
}