Skip to content

Commit 881bcbe

Browse files
committed
Updated Rector to commit bc3a50188be303409d4d2ee86c21f5d00de0c6f9
rectorphp/rector-src@bc3a501 [Transform] Do not call parent::construct() when parent __construct() is private (#6857)
1 parent 0e8bc21 commit 881bcbe

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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 = '1fd4615de691eb43a3f47a60cf14028247ca9d24';
22+
public const PACKAGE_VERSION = 'bc3a50188be303409d4d2ee86c21f5d00de0c6f9';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-04-22 10:24:46';
27+
public const RELEASE_DATE = '2025-04-22 10:51:40';
2828
/**
2929
* @var int
3030
*/

src/NodeManipulator/ClassDependencyManipulator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ private function resolveConstruct(Class_ $class) : ?ClassMethod
186186
if (!$parentConstructorMethod instanceof ClassMethod) {
187187
continue;
188188
}
189+
if ($parentConstructorMethod->isPrivate()) {
190+
// stop, nearest __construct() uses private visibility
191+
// which parent::__construct() will cause error
192+
break;
193+
}
189194
// reprint parent method node to avoid invalid tokens
190195
$this->nodeFactory->createReprintedNode($parentConstructorMethod);
191196
return $parentConstructorMethod;

0 commit comments

Comments
 (0)