Skip to content

Commit 3587b00

Browse files
authored
[internal] Mark beforeTraverse() in AbstractRector as @Final to prevent override and miss-use (#7727)
1 parent 7188ba6 commit 3587b00

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,3 +408,8 @@ parameters:
408408
-
409409
identifier: rector.noOnlyNullReturnInRefactor
410410
path: rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php
411+
412+
# handle next with FileNode
413+
-
414+
identifier: method.parentMethodFinalByPhpDoc
415+
path: rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php

src/Rector/AbstractRector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ public function autowire(
106106
}
107107

108108
/**
109+
* @final Avoid override to prevent unintended side-effects. Use enterNode() or @see \Rector\Contract\PhpParser\DecoratingNodeVisitorInterface instead.
110+
*
111+
* @internal
112+
*
109113
* @return Node[]|null
110114
*/
111115
public function beforeTraverse(array $nodes): ?array

0 commit comments

Comments
 (0)