Skip to content

Commit 0d5db11

Browse files
committed
Updated Rector to commit 3b1717892dd2502a9ecdd67c8e498fe118ed687a
rectorphp/rector-src@3b17178 allow empty in StrictArrayParamDimFetchRector to make rule more practical (#7429)
1 parent 16058b7 commit 0d5db11

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ private function isParamAccessedArrayDimFetch(Param $param, $functionLike): bool
126126
}
127127
$paramName = $this->getName($param);
128128
$isParamAccessedArrayDimFetch = \false;
129-
$this->traverseNodesWithCallable($functionLike->stmts, function (Node $node) use ($param, $paramName, &$isParamAccessedArrayDimFetch): ?int {
129+
$this->traverseNodesWithCallable($functionLike->stmts, function (Node $node) use ($paramName, &$isParamAccessedArrayDimFetch): ?int {
130130
if ($node instanceof Class_ || $node instanceof FunctionLike) {
131131
return NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
132132
}
133-
if ($this->shouldStop($node, $param, $paramName)) {
133+
if ($this->shouldStop($node, $paramName)) {
134134
// force set to false to avoid too early replaced
135135
$isParamAccessedArrayDimFetch = \false;
136136
return NodeVisitor::STOP_TRAVERSAL;
@@ -185,12 +185,9 @@ private function isEchoed(Node $node, string $paramName): bool
185185
}
186186
return \false;
187187
}
188-
private function shouldStop(Node $node, Param $param, string $paramName): bool
188+
private function shouldStop(Node $node, string $paramName): bool
189189
{
190190
$nodeToCheck = null;
191-
if (!$param->default instanceof Expr && ($node instanceof Empty_ && $node->expr instanceof ArrayDimFetch && $node->expr->var instanceof Variable && $node->expr->var->name === $paramName)) {
192-
return \true;
193-
}
194191
if ($node instanceof FuncCall && !$node->isFirstClassCallable() && $this->isNames($node, ['is_array', 'is_string', 'is_int', 'is_bool', 'is_float'])) {
195192
$firstArg = $node->getArgs()[0];
196193
$nodeToCheck = $firstArg->value;

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 = '0279c0001f2d803df386747d4aa45588235dd58a';
22+
public const PACKAGE_VERSION = '3b1717892dd2502a9ecdd67c8e498fe118ed687a';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-10-05 14:47:04';
27+
public const RELEASE_DATE = '2025-10-05 15:33:37';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)