@@ -115,11 +115,11 @@ public function testValidatesPathArgument(): void
115115 Visitor::visit (
116116 $ ast ,
117117 [
118- 'enter ' => function ($ node , $ key , $ parent , $ path ) use ($ ast , &$ visited ): void {
118+ 'enter ' => function (Node $ node , $ key , $ parent , array $ path ) use ($ ast , &$ visited ): void {
119119 $ this ->checkVisitorFnArgs ($ ast , func_get_args ());
120120 $ visited [] = ['enter ' , $ path ];
121121 },
122- 'leave ' => function ($ node , $ key , $ parent , $ path ) use ($ ast , &$ visited ): void {
122+ 'leave ' => function (Node $ node , $ key , $ parent , array $ path ) use ($ ast , &$ visited ): void {
123123 $ this ->checkVisitorFnArgs ($ ast , func_get_args ());
124124 $ visited [] = ['leave ' , $ path ];
125125 },
@@ -149,7 +149,7 @@ public function testValidatesAncestorsArgument(): void
149149 $ visitedNodes = [];
150150
151151 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 {
153153 $ inArray = is_numeric ($ key );
154154 if ($ inArray ) {
155155 $ visitedNodes [] = $ parent ;
@@ -160,7 +160,7 @@ public function testValidatesAncestorsArgument(): void
160160 $ expectedAncestors = array_slice ($ visitedNodes , 0 , -2 );
161161 self ::assertEquals ($ expectedAncestors , $ ancestors );
162162 },
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 {
164164 $ expectedAncestors = array_slice ($ visitedNodes , 0 , -2 );
165165 self ::assertEquals ($ expectedAncestors , $ ancestors );
166166
@@ -363,7 +363,7 @@ public function testAllowsSkippingASubTree(): void
363363 Visitor::visit (
364364 $ ast ,
365365 [
366- 'enter ' => function (Node $ node ) use (&$ visited , $ ast ): ?VisitorOperation {
366+ 'enter ' => function ($ node ) use (&$ visited , $ ast ): ?VisitorOperation {
367367 $ this ->checkVisitorFnArgs ($ ast , func_get_args ());
368368 $ visited [] = ['enter ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
369369 if ($ node instanceof FieldNode && $ node ->name ->value === 'b ' ) {
@@ -372,7 +372,7 @@ public function testAllowsSkippingASubTree(): void
372372
373373 return null ;
374374 },
375- 'leave ' => function (Node $ node ) use (&$ visited , $ ast ): void {
375+ 'leave ' => function ($ node ) use (&$ visited , $ ast ): void {
376376 $ this ->checkVisitorFnArgs ($ ast , func_get_args ());
377377 $ visited [] = ['leave ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
378378 },
@@ -408,7 +408,7 @@ public function testAllowsEarlyExitWhileVisiting(): void
408408 Visitor::visit (
409409 $ ast ,
410410 [
411- 'enter ' => function (Node $ node ) use (&$ visited , $ ast ): ?VisitorOperation {
411+ 'enter ' => function ($ node ) use (&$ visited , $ ast ): ?VisitorOperation {
412412 $ this ->checkVisitorFnArgs ($ ast , func_get_args ());
413413 $ visited [] = ['enter ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
414414 if ($ node instanceof NameNode && $ node ->value === 'x ' ) {
@@ -417,7 +417,7 @@ public function testAllowsEarlyExitWhileVisiting(): void
417417
418418 return null ;
419419 },
420- 'leave ' => function (Node $ node ) use (&$ visited , $ ast ): void {
420+ 'leave ' => function ($ node ) use (&$ visited , $ ast ): void {
421421 $ this ->checkVisitorFnArgs ($ ast , func_get_args ());
422422 $ visited [] = ['leave ' , $ node ->kind , property_exists ($ node , 'value ' ) ? $ node ->value : null ];
423423 },
0 commit comments