From 4bc6d6a3b420aad5295e5eaeeaa4e455ec2cb4ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Sun, 8 Jul 2018 20:58:46 +0000 Subject: [PATCH] StrictParamFixer - make it case-insensitive --- src/Fixer/Strict/StrictParamFixer.php | 5 +++-- tests/Fixer/Strict/StrictParamFixerTest.php | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Fixer/Strict/StrictParamFixer.php b/src/Fixer/Strict/StrictParamFixer.php index fcaaa0796d0..f0e944e4ac3 100644 --- a/src/Fixer/Strict/StrictParamFixer.php +++ b/src/Fixer/Strict/StrictParamFixer.php @@ -80,8 +80,9 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens) return; } - if ($token->isGivenKind(T_STRING) && isset($map[$token->getContent()])) { - $this->fixFunction($tokens, $index, $map[$token->getContent()]); + $lowercaseContent = strtolower($token->getContent()); + if ($token->isGivenKind(T_STRING) && isset($map[$lowercaseContent])) { + $this->fixFunction($tokens, $index, $map[$lowercaseContent]); } } } diff --git a/tests/Fixer/Strict/StrictParamFixerTest.php b/tests/Fixer/Strict/StrictParamFixerTest.php index 67b2576d628..8e3131f81d3 100644 --- a/tests/Fixer/Strict/StrictParamFixerTest.php +++ b/tests/Fixer/Strict/StrictParamFixerTest.php @@ -75,6 +75,12 @@ public function provideFixCases() ], [ '