Skip to content

Commit 3803546

Browse files
authored
[CodingStyle] Early first class callable check on FunctionLikeToFirstClassCallableRector (#7267)
* [CodingStyle] Early first class callable check on FunctionLikeToFirstClassCallableRector * fix
1 parent 93627ab commit 3803546

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
namespace Rector\Tests\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector\Fixture;
4+
5+
function ($parameter) { return Call::to(...); };

rules/CodingStyle/Rector/FunctionLike/FunctionLikeToFirstClassCallableRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ private function shouldSkip(
7676
Scope $scope
7777
): bool {
7878
$params = $node->getParams();
79-
$args = $callLike->getArgs();
8079
if ($callLike->isFirstClassCallable()) {
8180
return true;
8281
}
8382

83+
$args = $callLike->getArgs();
8484
if ($this->isChainedCall($callLike)) {
8585
return true;
8686
}

0 commit comments

Comments
 (0)