From 6311c8b5c95f79e5127038003d2ccdab8a6e285c Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 16 Jun 2021 17:30:01 +0700 Subject: [PATCH] [Util] Early strtolower() on StaticRectorStrings::isInArrayInsensitive() (#232) --- src/Util/StaticRectorStrings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Util/StaticRectorStrings.php b/src/Util/StaticRectorStrings.php index 049d71b1057..ca15ee769a1 100644 --- a/src/Util/StaticRectorStrings.php +++ b/src/Util/StaticRectorStrings.php @@ -37,8 +37,9 @@ public static function camelCaseToUnderscore(string $input): string */ public static function isInArrayInsensitive(string $checkedItem, array $array): bool { + $checkedItem = strtolower($checkedItem); foreach ($array as $singleArray) { - if (strtolower($singleArray) === strtolower($checkedItem)) { + if (strtolower($singleArray) === $checkedItem) { return true; } }