Skip to content

Commit 9097bd6

Browse files
committed
Updated Rector to commit d229205e5dbdf68c15d44a373203217368603361
rectorphp/rector-src@d229205 register ClosureFromCallableToFirstClassCallableRector to PHP 8.1 set
1 parent 56ae76d commit 9097bd6

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

config/set/php81.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare (strict_types=1);
44
namespace RectorPrefix202510;
55

6+
use Rector\CodingStyle\Rector\FuncCall\ClosureFromCallableToFirstClassCallableRector;
67
use Rector\CodingStyle\Rector\FunctionLike\FunctionLikeToFirstClassCallableRector;
78
use Rector\Config\RectorConfig;
89
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
@@ -31,6 +32,7 @@
3132
FirstClassCallableRector::class,
3233
// closure/arrow function
3334
FunctionLikeToFirstClassCallableRector::class,
35+
ClosureFromCallableToFirstClassCallableRector::class,
3436
RemoveReflectionSetAccessibleCallsRector::class,
3537
]);
3638
};

rules/CodingStyle/Rector/FuncCall/ClosureFromCallableToFirstClassCallableRector.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,26 @@ public function refactor(Node $node): ?Node
5454
return new FuncCall($this->toFullyQualified($arg->value->value), [new VariadicPlaceholder()]);
5555
}
5656
if ($arg->value instanceof Array_) {
57-
if (!array_key_exists(0, $arg->value->items) || !array_key_exists(1, $arg->value->items) || !$arg->value->items[1]->value instanceof String_) {
57+
$array = $arg->value;
58+
if (!array_key_exists(0, $array->items) || !array_key_exists(1, $array->items) || !$array->items[1]->value instanceof String_) {
5859
return null;
5960
}
60-
if ($arg->value->items[0]->value instanceof Variable) {
61-
return new MethodCall($arg->value->items[0]->value, $arg->value->items[1]->value->value, [new VariadicPlaceholder()]);
61+
if ($array->items[0]->value instanceof Variable) {
62+
return new MethodCall($array->items[0]->value, $array->items[1]->value->value, [new VariadicPlaceholder()]);
6263
}
63-
if ($arg->value->items[0]->value instanceof String_) {
64-
$classNode = new FullyQualified($arg->value->items[0]->value->value);
65-
} elseif ($arg->value->items[0]->value instanceof ClassConstFetch) {
66-
if ($arg->value->items[0]->value->class instanceof Expr) {
64+
if ($array->items[0]->value instanceof String_) {
65+
$classNode = new FullyQualified($array->items[0]->value->value);
66+
} elseif ($array->items[0]->value instanceof ClassConstFetch) {
67+
if ($array->items[0]->value->class instanceof Expr) {
6768
return null;
6869
}
69-
$classNode = new FullyQualified($arg->value->items[0]->value->class->name);
70-
} elseif ($arg->value->items[0]->value instanceof FullyQualified) {
71-
$classNode = new FullyQualified($arg->value->items[0]->value->name);
70+
$classNode = new FullyQualified($array->items[0]->value->class->name);
71+
} elseif ($array->items[0]->value instanceof FullyQualified) {
72+
$classNode = new FullyQualified($array->items[0]->value->name);
7273
} else {
7374
return null;
7475
}
75-
return new StaticCall($classNode, $arg->value->items[1]->value->value, [new VariadicPlaceholder()]);
76+
return new StaticCall($classNode, $array->items[1]->value->value, [new VariadicPlaceholder()]);
7677
}
7778
return $node;
7879
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'b6353b73d2497e03392587b40a497251aa662e6d';
22+
public const PACKAGE_VERSION = 'd229205e5dbdf68c15d44a373203217368603361';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-10-23 00:28:12';
27+
public const RELEASE_DATE = '2025-10-23 00:47:59';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)