File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 2828 "phpunit/phpcov" : " ^9.0.2 || ^10.0" ,
2929 "phpunit/phpunit" : " ^10.5.16 || ^11.2" ,
3030 "predis/predis" : " ^3.0" ,
31- "rector/rector" : " 2.2.14 " ,
31+ "rector/rector" : " 2.3.0 " ,
3232 "shipmonk/phpstan-baseline-per-identifier" : " ^2.0"
3333 },
3434 "replace" : {
Original file line number Diff line number Diff line change 2323use PhpParser \Node \Stmt \Namespace_ ;
2424use Rector \BetterPhpDocParser \PhpDocInfo \PhpDocInfoFactory ;
2525use Rector \Php \ReservedKeywordAnalyzer ;
26- use Rector \PhpParser \Node \CustomNode \ FileWithoutNamespace ;
26+ use Rector \PhpParser \Node \FileNode ;
2727use Rector \Rector \AbstractRector ;
2828use Symplify \RuleDocGenerator \ValueObject \CodeSample \CodeSample ;
2929use Symplify \RuleDocGenerator \ValueObject \RuleDefinition ;
@@ -77,14 +77,19 @@ public function run($aB)
7777 */
7878 public function getNodeTypes (): array
7979 {
80- return [FileWithoutNamespace ::class, Namespace_::class];
80+ return [FileNode ::class, Namespace_::class];
8181 }
8282
8383 /**
84- * @param ClassMethod|Closure|FileWithoutNamespace|Function_ |Namespace_ $node
84+ * @param FileNode |Namespace_ $node
8585 */
8686 public function refactor (Node $ node ): ?Node
8787 {
88+ if ($ node instanceof FileNode && $ node ->isNamespaced ()) {
89+ // handled in Namespace_ node
90+ return null ;
91+ }
92+
8893 if ($ node ->stmts === null ) {
8994 return null ;
9095 }
You can’t perform that action at this time.
0 commit comments