Skip to content

Commit

Permalink
Skip first class callables in NullToStrictStringFuncCallArgRector (#2919
Browse files Browse the repository at this point in the history
)
  • Loading branch information
thomasschiet committed Sep 7, 2022
1 parent 90adbf0 commit 2975a1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Rector\Tests\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector\Fixture;

final class SkipFirstClassCallable
{
public function run()
{
array_map(trim(...), [' ']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,6 @@ private function resolveOriginalPositions(FuncCall $funcCall): array
private function shouldSkip(FuncCall $funcCall): bool
{
$functionNames = array_keys(self::ARG_POSITION_NAME_NULL_TO_STRICT_STRING);
return ! $this->nodeNameResolver->isNames($funcCall, $functionNames);
return ! $this->nodeNameResolver->isNames($funcCall, $functionNames) || $funcCall->isFirstClassCallable();
}
}

0 comments on commit 2975a1b

Please sign in to comment.