Skip to content

Commit

Permalink
bug #3890 StrictParamFixer - make it case-insensitive (kubawerlos)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.12 branch (closes #3890).

Discussion
----------

StrictParamFixer - make it case-insensitive

Commits
-------

4bc6d6a StrictParamFixer - make it case-insensitive
  • Loading branch information
SpacePossum committed Jul 10, 2018
2 parents 57857e6 + 4bc6d6a commit 61dd60e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Fixer/Strict/StrictParamFixer.php
Expand Up @@ -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]);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions tests/Fixer/Strict/StrictParamFixerTest.php
Expand Up @@ -75,6 +75,12 @@ public function provideFixCases()
],
[
'<?php
in_Array(1, $a, true);',
'<?php
in_Array(1, $a);',
],
[
'<?php
base64_decode($foo, true);
base64_decode($foo, false);
base64_decode($foo, $useStrict);',
Expand Down

0 comments on commit 61dd60e

Please sign in to comment.