Skip to content

Commit

Permalink
StrictParamFixer - fix edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored and keradus committed Aug 10, 2018
1 parent f75251b commit 29c6aad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fixer/Strict/StrictParamFixer.php
Expand Up @@ -77,7 +77,7 @@ protected function applyFix(\SplFileInfo $file, Tokens $tokens)

$previousIndex = $tokens->getPrevMeaningfulToken($index);
if (null !== $previousIndex && $tokens[$previousIndex]->isGivenKind(CT::T_FUNCTION_IMPORT)) {
return;
continue;
}

$lowercaseContent = strtolower($token->getContent());
Expand Down
18 changes: 18 additions & 0 deletions tests/Fixer/Strict/StrictParamFixerTest.php
Expand Up @@ -135,6 +135,24 @@ public function provideFixCases()
class Foo
{
public function __construct($foo, $bar) {}
}',
],
[
'<?php
namespace Foo {
array_keys($foo, $bar, true);
}
namespace Bar {
use function Foo\LoremIpsum;
array_keys($foo, $bar, true);
}',
'<?php
namespace Foo {
array_keys($foo, $bar);
}
namespace Bar {
use function Foo\LoremIpsum;
array_keys($foo, $bar);
}',
],
];
Expand Down

0 comments on commit 29c6aad

Please sign in to comment.