From 2a333c1de6db64c28101197255ae95232d44dd5a Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Sun, 16 Jan 2022 15:19:40 +0100 Subject: [PATCH] Simplify MD_STD::startsWithAny --- src/MD_STD.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/MD_STD.php b/src/MD_STD.php index a7eac82..8a5504d 100644 --- a/src/MD_STD.php +++ b/src/MD_STD.php @@ -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; }