@@ -115,11 +115,11 @@ public function testValidatesPathArgument(): void
115
115
Visitor::visit (
116
116
$ ast ,
117
117
[
118
- 'enter ' => function ($ node , $ key , $ parent , $ path ) use ($ ast , &$ visited ): void {
118
+ 'enter ' => function (Node $ node , $ key , $ parent , array $ path ) use ($ ast , &$ visited ): void {
119
119
$ this ->checkVisitorFnArgs ($ ast , func_get_args ());
120
120
$ visited [] = ['enter ' , $ path ];
121
121
},
122
- 'leave ' => function ($ node , $ key , $ parent , $ path ) use ($ ast , &$ visited ): void {
122
+ 'leave ' => function (Node $ node , $ key , $ parent , array $ path ) use ($ ast , &$ visited ): void {
123
123
$ this ->checkVisitorFnArgs ($ ast , func_get_args ());
124
124
$ visited [] = ['leave ' , $ path ];
125
125
},
@@ -149,7 +149,7 @@ public function testValidatesAncestorsArgument(): void
149
149
$ visitedNodes = [];
150
150
151
151
Visitor::visit ($ ast , [
152
- 'enter ' => static function ($ node , $ key , $ parent , $ path , $ ancestors ) use (&$ visitedNodes ): void {
152
+ 'enter ' => static function (Node $ node , $ key , $ parent , array $ path , array $ ancestors ) use (&$ visitedNodes ): void {
153
153
$ inArray = is_numeric ($ key );
154
154
if ($ inArray ) {
155
155
$ visitedNodes [] = $ parent ;
@@ -160,7 +160,7 @@ public function testValidatesAncestorsArgument(): void
160
160
$ expectedAncestors = array_slice ($ visitedNodes , 0 , -2 );
161
161
self ::assertEquals ($ expectedAncestors , $ ancestors );
162
162
},
163
- 'leave ' => static function ($ node , $ key , $ parent , $ path , $ ancestors ) use (&$ visitedNodes ): void {
163
+ 'leave ' => static function (Node $ node , $ key , $ parent , array $ path , array $ ancestors ) use (&$ visitedNodes ): void {
164
164
$ expectedAncestors = array_slice ($ visitedNodes , 0 , -2 );
165
165
self ::assertEquals ($ expectedAncestors , $ ancestors );
166
166
@@ -363,7 +363,7 @@ public function testAllowsSkippingASubTree(): void
363
363
Visitor::visit (
364
364
$ ast ,
365
365
[
366
- 'enter ' => function (Node $ node ) use (&$ visited , $ ast ): ?VisitorOperation {
366
+ 'enter ' => function ($ node ) use (&$ visited , $ ast ): ?VisitorOperation {
367
367
$ this ->checkVisitorFnArgs ($ ast , func_get_args ());
368
368
$ visited [] = ['enter ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
369
369
if ($ node instanceof FieldNode && $ node ->name ->value === 'b ' ) {
@@ -372,7 +372,7 @@ public function testAllowsSkippingASubTree(): void
372
372
373
373
return null ;
374
374
},
375
- 'leave ' => function (Node $ node ) use (&$ visited , $ ast ): void {
375
+ 'leave ' => function ($ node ) use (&$ visited , $ ast ): void {
376
376
$ this ->checkVisitorFnArgs ($ ast , func_get_args ());
377
377
$ visited [] = ['leave ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
378
378
},
@@ -408,7 +408,7 @@ public function testAllowsEarlyExitWhileVisiting(): void
408
408
Visitor::visit (
409
409
$ ast ,
410
410
[
411
- 'enter ' => function (Node $ node ) use (&$ visited , $ ast ): ?VisitorOperation {
411
+ 'enter ' => function ($ node ) use (&$ visited , $ ast ): ?VisitorOperation {
412
412
$ this ->checkVisitorFnArgs ($ ast , func_get_args ());
413
413
$ visited [] = ['enter ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
414
414
if ($ node instanceof NameNode && $ node ->value === 'x ' ) {
@@ -417,7 +417,7 @@ public function testAllowsEarlyExitWhileVisiting(): void
417
417
418
418
return null ;
419
419
},
420
- 'leave ' => function (Node $ node ) use (&$ visited , $ ast ): void {
420
+ 'leave ' => function ($ node ) use (&$ visited , $ ast ): void {
421
421
$ this ->checkVisitorFnArgs ($ ast , func_get_args ());
422
422
$ visited [] = ['leave ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
423
423
},
0 commit comments