Skip to content

Commit d398cd1

Browse files
committed
Updated Rector to commit 4b409e1205b1e98535cf5b9dc76eb37d8ed6dc94
rectorphp/rector-src@4b409e1 [TypeDeclaration] Skip override from parent method on AddParamStringTypeFromSprintfUseRector (#7479)
1 parent 91816e6 commit d398cd1

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

rules/TypeDeclaration/Rector/ClassMethod/AddParamStringTypeFromSprintfUseRector.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use PhpParser\Node\Stmt\Function_;
1010
use Rector\Rector\AbstractRector;
1111
use Rector\TypeDeclaration\NodeAnalyzer\VariableInSprintfMaskMatcher;
12+
use Rector\VendorLocker\ParentClassMethodTypeOverrideGuard;
1213
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1314
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
1415
/**
@@ -20,9 +21,14 @@ final class AddParamStringTypeFromSprintfUseRector extends AbstractRector
2021
* @readonly
2122
*/
2223
private VariableInSprintfMaskMatcher $variableInSprintfMaskMatcher;
23-
public function __construct(VariableInSprintfMaskMatcher $variableInSprintfMaskMatcher)
24+
/**
25+
* @readonly
26+
*/
27+
private ParentClassMethodTypeOverrideGuard $parentClassMethodTypeOverrideGuard;
28+
public function __construct(VariableInSprintfMaskMatcher $variableInSprintfMaskMatcher, ParentClassMethodTypeOverrideGuard $parentClassMethodTypeOverrideGuard)
2429
{
2530
$this->variableInSprintfMaskMatcher = $variableInSprintfMaskMatcher;
31+
$this->parentClassMethodTypeOverrideGuard = $parentClassMethodTypeOverrideGuard;
2632
}
2733
public function getRuleDefinition(): RuleDefinition
2834
{
@@ -65,6 +71,9 @@ public function refactor(Node $node)
6571
if ($node->getParams() === []) {
6672
return null;
6773
}
74+
if ($node instanceof ClassMethod && $this->parentClassMethodTypeOverrideGuard->hasParentClassMethod($node)) {
75+
return null;
76+
}
6877
$hasChanged = \false;
6978
foreach ($node->getParams() as $param) {
7079
if ($param->type instanceof Node) {

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 = '0a555c872e86970e85f5466675eabf5962fed325';
22+
public const PACKAGE_VERSION = '4b409e1205b1e98535cf5b9dc76eb37d8ed6dc94';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-10-11 22:50:45';
27+
public const RELEASE_DATE = '2025-10-11 21:01:06';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)