File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,7 @@ public function beforeTraverse(array $nodes): ?array
4444 #[Override]
4545 public function enterNode (Node $ node ): ?Node
4646 {
47- if ($ this ->topNode === null ) {
48- $ this ->topNode = $ node ;
49- }
47+ $ this ->topNode ??= $ node ;
5048
5149 if ($ node instanceof Node \Stmt \Namespace_ && $ node ->name !== null ) {
5250 $ this ->inNamespace = $ node ->name ->toString ();
Original file line number Diff line number Diff line change @@ -53,9 +53,7 @@ public function beforeTraverse(array $nodes): ?array
5353 #[Override]
5454 public function enterNode (Node $ node ): ?Node
5555 {
56- if ($ this ->topNode === null ) {
57- $ this ->topNode = $ node ;
58- }
56+ $ this ->topNode ??= $ node ;
5957
6058 if ($ node instanceof Node \Stmt \Namespace_ && $ node ->name !== null ) {
6159 $ this ->inNamespace = $ node ->name ->toString ();
You can’t perform that action at this time.
0 commit comments