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
44
44
#[Override]
45
45
public function enterNode (Node $ node ): ?Node
46
46
{
47
- if ($ this ->topNode === null ) {
48
- $ this ->topNode = $ node ;
49
- }
47
+ $ this ->topNode ??= $ node ;
50
48
51
49
if ($ node instanceof Node \Stmt \Namespace_ && $ node ->name !== null ) {
52
50
$ 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
53
53
#[Override]
54
54
public function enterNode (Node $ node ): ?Node
55
55
{
56
- if ($ this ->topNode === null ) {
57
- $ this ->topNode = $ node ;
58
- }
56
+ $ this ->topNode ??= $ node ;
59
57
60
58
if ($ node instanceof Node \Stmt \Namespace_ && $ node ->name !== null ) {
61
59
$ this ->inNamespace = $ node ->name ->toString ();
You can’t perform that action at this time.
0 commit comments