Total Complexity | 88 |
Total Lines | 792 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Complex classes like SpecificKindVisitor often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use SpecificKindVisitor, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
50 | class SpecificKindVisitor implements VisitorInterface |
||
51 | { |
||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | public function enterNode(NodeInterface $node): VisitorResult |
||
56 | { |
||
57 | $enterMethod = 'enter' . $node->getKind(); |
||
58 | return $this->{$enterMethod}($node); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | */ |
||
64 | public function leaveNode(NodeInterface $node): VisitorResult |
||
65 | { |
||
66 | $leaveMethod = 'leave' . $node->getKind(); |
||
67 | return $this->{$leaveMethod}($node); |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @param ArgumentNode $node |
||
72 | * @return VisitorResult |
||
73 | */ |
||
74 | protected function enterArgument(ArgumentNode $node): VisitorResult |
||
75 | { |
||
76 | return new VisitorResult($node); |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @param ArgumentNode $node |
||
81 | * @return VisitorResult |
||
82 | */ |
||
83 | protected function leaveArgument(ArgumentNode $node): VisitorResult |
||
84 | { |
||
85 | return new VisitorResult($node); |
||
86 | } |
||
87 | |||
88 | /** |
||
89 | * @param BooleanValueNode $node |
||
90 | * @return VisitorResult |
||
91 | */ |
||
92 | protected function enterBooleanValue(BooleanValueNode $node): VisitorResult |
||
93 | { |
||
94 | return new VisitorResult($node); |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * @param BooleanValueNode $node |
||
99 | * @return VisitorResult |
||
100 | */ |
||
101 | protected function leaveBooleanValue(BooleanValueNode $node): VisitorResult |
||
102 | { |
||
103 | return new VisitorResult($node); |
||
104 | } |
||
105 | |||
106 | /** |
||
107 | * @param DirectiveDefinitionNode $node |
||
108 | * @return VisitorResult |
||
109 | */ |
||
110 | protected function enterDirectiveDefinition(DirectiveDefinitionNode $node): VisitorResult |
||
111 | { |
||
112 | return new VisitorResult($node); |
||
113 | } |
||
114 | |||
115 | /** |
||
116 | * @param DirectiveDefinitionNode $node |
||
117 | * @return VisitorResult |
||
118 | */ |
||
119 | protected function leaveDirectiveDefinition(DirectiveDefinitionNode $node): VisitorResult |
||
120 | { |
||
121 | return new VisitorResult($node); |
||
122 | } |
||
123 | |||
124 | /** |
||
125 | * @param DirectiveNode $node |
||
126 | * @return VisitorResult |
||
127 | */ |
||
128 | protected function enterDirective(DirectiveNode $node): VisitorResult |
||
129 | { |
||
130 | return new VisitorResult($node); |
||
131 | } |
||
132 | |||
133 | /** |
||
134 | * @param DirectiveNode $node |
||
135 | * @return VisitorResult |
||
136 | */ |
||
137 | protected function leaveDirective(DirectiveNode $node): VisitorResult |
||
138 | { |
||
139 | return new VisitorResult($node); |
||
140 | } |
||
141 | |||
142 | /** |
||
143 | * @param DocumentNode $node |
||
144 | * @return VisitorResult |
||
145 | */ |
||
146 | protected function enterDocument(DocumentNode $node): VisitorResult |
||
147 | { |
||
148 | return new VisitorResult($node); |
||
149 | } |
||
150 | |||
151 | /** |
||
152 | * @param DocumentNode $node |
||
153 | * @return VisitorResult |
||
154 | */ |
||
155 | protected function leaveDocument(DocumentNode $node): VisitorResult |
||
156 | { |
||
157 | return new VisitorResult($node); |
||
158 | } |
||
159 | |||
160 | /** |
||
161 | * @param EnumTypeDefinitionNode $node |
||
162 | * @return VisitorResult |
||
163 | */ |
||
164 | protected function enterEnumTypeDefinition(EnumTypeDefinitionNode $node): VisitorResult |
||
165 | { |
||
166 | return new VisitorResult($node); |
||
167 | } |
||
168 | |||
169 | /** |
||
170 | * @param EnumTypeDefinitionNode $node |
||
171 | * @return VisitorResult |
||
172 | */ |
||
173 | protected function leaveEnumTypeDefinition(EnumTypeDefinitionNode $node): VisitorResult |
||
174 | { |
||
175 | return new VisitorResult($node); |
||
176 | } |
||
177 | |||
178 | /** |
||
179 | * @param EnumTypeExtensionNode $node |
||
180 | * @return VisitorResult |
||
181 | */ |
||
182 | protected function enterEnumTypeExtension(EnumTypeExtensionNode $node): VisitorResult |
||
183 | { |
||
184 | return new VisitorResult($node); |
||
185 | } |
||
186 | |||
187 | /** |
||
188 | * @param EnumTypeExtensionNode $node |
||
189 | * @return VisitorResult |
||
190 | */ |
||
191 | protected function leaveEnumTypeExtension(EnumTypeExtensionNode $node): VisitorResult |
||
192 | { |
||
193 | return new VisitorResult($node); |
||
194 | } |
||
195 | |||
196 | /** |
||
197 | * @param EnumValueDefinitionNode $node |
||
198 | * @return VisitorResult |
||
199 | */ |
||
200 | protected function enterEnumValueDefinition(EnumValueDefinitionNode $node): VisitorResult |
||
201 | { |
||
202 | return new VisitorResult($node); |
||
203 | } |
||
204 | |||
205 | /** |
||
206 | * @param EnumValueDefinitionNode $node |
||
207 | * @return VisitorResult |
||
208 | */ |
||
209 | protected function leaveEnumValueDefinition(EnumValueDefinitionNode $node): VisitorResult |
||
210 | { |
||
211 | return new VisitorResult($node); |
||
212 | } |
||
213 | |||
214 | /** |
||
215 | * @param EnumValueNode $node |
||
216 | * @return VisitorResult |
||
217 | */ |
||
218 | protected function enterEnumValue(EnumValueNode $node): VisitorResult |
||
219 | { |
||
220 | return new VisitorResult($node); |
||
221 | } |
||
222 | |||
223 | /** |
||
224 | * @param EnumValueNode $node |
||
225 | * @return VisitorResult |
||
226 | */ |
||
227 | protected function leaveEnumValue(EnumValueNode $node): VisitorResult |
||
228 | { |
||
229 | return new VisitorResult($node); |
||
230 | } |
||
231 | |||
232 | /** |
||
233 | * @param FieldDefinitionNode $node |
||
234 | * @return VisitorResult |
||
235 | */ |
||
236 | protected function enterFieldDefinition(FieldDefinitionNode $node): VisitorResult |
||
237 | { |
||
238 | return new VisitorResult($node); |
||
239 | } |
||
240 | |||
241 | /** |
||
242 | * @param FieldDefinitionNode $node |
||
243 | * @return VisitorResult |
||
244 | */ |
||
245 | protected function leaveFieldDefinition(FieldDefinitionNode $node): VisitorResult |
||
246 | { |
||
247 | return new VisitorResult($node); |
||
248 | } |
||
249 | |||
250 | /** |
||
251 | * @param FieldNode $node |
||
252 | * @return VisitorResult |
||
253 | */ |
||
254 | protected function enterField(FieldNode $node): VisitorResult |
||
255 | { |
||
256 | return new VisitorResult($node); |
||
257 | } |
||
258 | |||
259 | /** |
||
260 | * @param FieldNode $node |
||
261 | * @return VisitorResult |
||
262 | */ |
||
263 | protected function leaveField(FieldNode $node): VisitorResult |
||
264 | { |
||
265 | return new VisitorResult($node); |
||
266 | } |
||
267 | |||
268 | /** |
||
269 | * @param FloatValueNode $node |
||
270 | * @return VisitorResult |
||
271 | */ |
||
272 | protected function enterFloatValue(FloatValueNode $node): VisitorResult |
||
273 | { |
||
274 | return new VisitorResult($node); |
||
275 | } |
||
276 | |||
277 | /** |
||
278 | * @param FloatValueNode $node |
||
279 | * @return VisitorResult |
||
280 | */ |
||
281 | protected function leaveFloatValue(FloatValueNode $node): VisitorResult |
||
282 | { |
||
283 | return new VisitorResult($node); |
||
284 | } |
||
285 | |||
286 | /** |
||
287 | * @param FragmentDefinitionNode $node |
||
288 | * @return VisitorResult |
||
289 | */ |
||
290 | protected function enterFragmentDefinition(FragmentDefinitionNode $node): VisitorResult |
||
291 | { |
||
292 | return new VisitorResult($node); |
||
293 | } |
||
294 | |||
295 | /** |
||
296 | * @param FragmentDefinitionNode $node |
||
297 | * @return VisitorResult |
||
298 | */ |
||
299 | protected function leaveFragmentDefinition(FragmentDefinitionNode $node): VisitorResult |
||
300 | { |
||
301 | return new VisitorResult($node); |
||
302 | } |
||
303 | |||
304 | /** |
||
305 | * @param FragmentSpreadNode $node |
||
306 | * @return VisitorResult |
||
307 | */ |
||
308 | protected function enterFragmentSpread(FragmentSpreadNode $node): VisitorResult |
||
309 | { |
||
310 | return new VisitorResult($node); |
||
311 | } |
||
312 | |||
313 | /** |
||
314 | * @param FragmentSpreadNode $node |
||
315 | * @return VisitorResult |
||
316 | */ |
||
317 | protected function leaveFragmentSpread(FragmentSpreadNode $node): VisitorResult |
||
318 | { |
||
319 | return new VisitorResult($node); |
||
320 | } |
||
321 | |||
322 | /** |
||
323 | * @param InlineFragmentNode $node |
||
324 | * @return VisitorResult |
||
325 | */ |
||
326 | protected function enterInlineFragment(InlineFragmentNode $node): VisitorResult |
||
327 | { |
||
328 | return new VisitorResult($node); |
||
329 | } |
||
330 | |||
331 | /** |
||
332 | * @param InlineFragmentNode $node |
||
333 | * @return VisitorResult |
||
334 | */ |
||
335 | protected function leaveInlineFragment(InlineFragmentNode $node): VisitorResult |
||
336 | { |
||
337 | return new VisitorResult($node); |
||
338 | } |
||
339 | |||
340 | /** |
||
341 | * @param InputObjectTypeDefinitionNode $node |
||
342 | * @return VisitorResult |
||
343 | */ |
||
344 | protected function enterInputObjectTypeDefinition(InputObjectTypeDefinitionNode $node): VisitorResult |
||
345 | { |
||
346 | return new VisitorResult($node); |
||
347 | } |
||
348 | |||
349 | /** |
||
350 | * @param InputObjectTypeDefinitionNode $node |
||
351 | * @return VisitorResult |
||
352 | */ |
||
353 | protected function leaveInputObjectTypeDefinition(InputObjectTypeDefinitionNode $node): VisitorResult |
||
354 | { |
||
355 | return new VisitorResult($node); |
||
356 | } |
||
357 | |||
358 | /** |
||
359 | * @param InputObjectTypeExtensionNode $node |
||
360 | * @return VisitorResult |
||
361 | */ |
||
362 | protected function enterInputObjectTypeExtension(InputObjectTypeExtensionNode $node): VisitorResult |
||
363 | { |
||
364 | return new VisitorResult($node); |
||
365 | } |
||
366 | |||
367 | /** |
||
368 | * @param InputObjectTypeExtensionNode $node |
||
369 | * @return VisitorResult |
||
370 | */ |
||
371 | protected function leaveInputObjectTypeExtension(InputObjectTypeExtensionNode $node): VisitorResult |
||
372 | { |
||
373 | return new VisitorResult($node); |
||
374 | } |
||
375 | |||
376 | /** |
||
377 | * @param InputValueDefinitionNode $node |
||
378 | * @return VisitorResult |
||
379 | */ |
||
380 | protected function enterInputValueDefinition(InputValueDefinitionNode $node): VisitorResult |
||
381 | { |
||
382 | return new VisitorResult($node); |
||
383 | } |
||
384 | |||
385 | /** |
||
386 | * @param InputValueDefinitionNode $node |
||
387 | * @return VisitorResult |
||
388 | */ |
||
389 | protected function leaveInputValueDefinition(InputValueDefinitionNode $node): VisitorResult |
||
390 | { |
||
391 | return new VisitorResult($node); |
||
392 | } |
||
393 | |||
394 | /** |
||
395 | * @param IntValueNode $node |
||
396 | * @return VisitorResult |
||
397 | */ |
||
398 | protected function enterIntValue(IntValueNode $node): VisitorResult |
||
399 | { |
||
400 | return new VisitorResult($node); |
||
401 | } |
||
402 | |||
403 | /** |
||
404 | * @param IntValueNode $node |
||
405 | * @return VisitorResult |
||
406 | */ |
||
407 | protected function leaveIntValue(IntValueNode $node): VisitorResult |
||
408 | { |
||
409 | return new VisitorResult($node); |
||
410 | } |
||
411 | |||
412 | /** |
||
413 | * @param InterfaceTypeDefinitionNode $node |
||
414 | * @return VisitorResult |
||
415 | */ |
||
416 | protected function enterInterfaceTypeDefinition(InterfaceTypeDefinitionNode $node): VisitorResult |
||
417 | { |
||
418 | return new VisitorResult($node); |
||
419 | } |
||
420 | |||
421 | /** |
||
422 | * @param InterfaceTypeDefinitionNode $node |
||
423 | * @return VisitorResult |
||
424 | */ |
||
425 | protected function leaveInterfaceTypeDefinition(InterfaceTypeDefinitionNode $node): VisitorResult |
||
426 | { |
||
427 | return new VisitorResult($node); |
||
428 | } |
||
429 | |||
430 | /** |
||
431 | * @param InterfaceTypeExtensionNode $node |
||
432 | * @return VisitorResult |
||
433 | */ |
||
434 | protected function enterInterfaceTypeExtension(InterfaceTypeExtensionNode $node): VisitorResult |
||
435 | { |
||
436 | return new VisitorResult($node); |
||
437 | } |
||
438 | |||
439 | /** |
||
440 | * @param InterfaceTypeExtensionNode $node |
||
441 | * @return VisitorResult |
||
442 | */ |
||
443 | protected function leaveInterfaceTypeExtension(InterfaceTypeExtensionNode $node): VisitorResult |
||
444 | { |
||
445 | return new VisitorResult($node); |
||
446 | } |
||
447 | |||
448 | /** |
||
449 | * @param ListTypeNode $node |
||
450 | * @return VisitorResult |
||
451 | */ |
||
452 | protected function enterListType(ListTypeNode $node): VisitorResult |
||
453 | { |
||
454 | return new VisitorResult($node); |
||
455 | } |
||
456 | |||
457 | /** |
||
458 | * @param ListTypeNode $node |
||
459 | * @return VisitorResult |
||
460 | */ |
||
461 | protected function leaveListType(ListTypeNode $node): VisitorResult |
||
462 | { |
||
463 | return new VisitorResult($node); |
||
464 | } |
||
465 | |||
466 | /** |
||
467 | * @param ListValueNode $node |
||
468 | * @return VisitorResult |
||
469 | */ |
||
470 | protected function enterListValue(ListValueNode $node): VisitorResult |
||
471 | { |
||
472 | return new VisitorResult($node); |
||
473 | } |
||
474 | |||
475 | /** |
||
476 | * @param ListValueNode $node |
||
477 | * @return VisitorResult |
||
478 | */ |
||
479 | protected function leaveListValue(ListValueNode $node): VisitorResult |
||
480 | { |
||
481 | return new VisitorResult($node); |
||
482 | } |
||
483 | |||
484 | /** |
||
485 | * @param NamedTypeNode $node |
||
486 | * @return VisitorResult |
||
487 | */ |
||
488 | protected function enterNamedType(NamedTypeNode $node): VisitorResult |
||
489 | { |
||
490 | return new VisitorResult($node); |
||
491 | } |
||
492 | |||
493 | /** |
||
494 | * @param NamedTypeNode $node |
||
495 | * @return VisitorResult |
||
496 | */ |
||
497 | protected function leaveNamedType(NamedTypeNode $node): VisitorResult |
||
498 | { |
||
499 | return new VisitorResult($node); |
||
500 | } |
||
501 | |||
502 | /** |
||
503 | * @param NameNode $node |
||
504 | * @return VisitorResult |
||
505 | */ |
||
506 | protected function enterName(NameNode $node): VisitorResult |
||
507 | { |
||
508 | return new VisitorResult($node); |
||
509 | } |
||
510 | |||
511 | /** |
||
512 | * @param NameNode $node |
||
513 | * @return VisitorResult |
||
514 | */ |
||
515 | protected function leaveName(NameNode $node): VisitorResult |
||
516 | { |
||
517 | return new VisitorResult($node); |
||
518 | } |
||
519 | |||
520 | /** |
||
521 | * @param NonNullTypeNode $node |
||
522 | * @return VisitorResult |
||
523 | */ |
||
524 | protected function enterNonNullType(NonNullTypeNode $node): VisitorResult |
||
525 | { |
||
526 | return new VisitorResult($node); |
||
527 | } |
||
528 | |||
529 | /** |
||
530 | * @param NonNullTypeNode $node |
||
531 | * @return VisitorResult |
||
532 | */ |
||
533 | protected function leaveNonNullType(NonNullTypeNode $node): VisitorResult |
||
534 | { |
||
535 | return new VisitorResult($node); |
||
536 | } |
||
537 | |||
538 | /** |
||
539 | * @param NullValueNode $node |
||
540 | * @return VisitorResult |
||
541 | */ |
||
542 | protected function enterNullValue(NullValueNode $node): VisitorResult |
||
543 | { |
||
544 | return new VisitorResult($node); |
||
545 | } |
||
546 | |||
547 | /** |
||
548 | * @param NullValueNode $node |
||
549 | * @return VisitorResult |
||
550 | */ |
||
551 | protected function leaveNullValue(NullValueNode $node): VisitorResult |
||
552 | { |
||
553 | return new VisitorResult($node); |
||
554 | } |
||
555 | |||
556 | /** |
||
557 | * @param ObjectFieldNode $node |
||
558 | * @return VisitorResult |
||
559 | */ |
||
560 | protected function enterObjectField(ObjectFieldNode $node): VisitorResult |
||
561 | { |
||
562 | return new VisitorResult($node); |
||
563 | } |
||
564 | |||
565 | /** |
||
566 | * @param ObjectFieldNode $node |
||
567 | * @return VisitorResult |
||
568 | */ |
||
569 | protected function leaveObjectField(ObjectFieldNode $node): VisitorResult |
||
570 | { |
||
571 | return new VisitorResult($node); |
||
572 | } |
||
573 | |||
574 | /** |
||
575 | * @param ObjectTypeDefinitionNode $node |
||
576 | * @return VisitorResult |
||
577 | */ |
||
578 | protected function enterObjectTypeDefinition(ObjectTypeDefinitionNode $node): VisitorResult |
||
579 | { |
||
580 | return new VisitorResult($node); |
||
581 | } |
||
582 | |||
583 | /** |
||
584 | * @param ObjectTypeDefinitionNode $node |
||
585 | * @return VisitorResult |
||
586 | */ |
||
587 | protected function leaveObjectTypeDefinition(ObjectTypeDefinitionNode $node): VisitorResult |
||
588 | { |
||
589 | return new VisitorResult($node); |
||
590 | } |
||
591 | |||
592 | /** |
||
593 | * @param ObjectTypeExtensionNode $node |
||
594 | * @return VisitorResult |
||
595 | */ |
||
596 | protected function enterObjectTypeExtension(ObjectTypeExtensionNode $node): VisitorResult |
||
597 | { |
||
598 | return new VisitorResult($node); |
||
599 | } |
||
600 | |||
601 | /** |
||
602 | * @param ObjectTypeExtensionNode $node |
||
603 | * @return VisitorResult |
||
604 | */ |
||
605 | protected function leaveObjectTypeExtension(ObjectTypeExtensionNode $node): VisitorResult |
||
606 | { |
||
607 | return new VisitorResult($node); |
||
608 | } |
||
609 | |||
610 | /** |
||
611 | * @param ObjectValueNode $node |
||
612 | * @return VisitorResult |
||
613 | */ |
||
614 | protected function enterObjectValue(ObjectValueNode $node): VisitorResult |
||
615 | { |
||
616 | return new VisitorResult($node); |
||
617 | } |
||
618 | |||
619 | /** |
||
620 | * @param ObjectValueNode $node |
||
621 | * @return VisitorResult |
||
622 | */ |
||
623 | protected function leaveObjectValue(ObjectValueNode $node): VisitorResult |
||
624 | { |
||
625 | return new VisitorResult($node); |
||
626 | } |
||
627 | |||
628 | /** |
||
629 | * @param OperationDefinitionNode $node |
||
630 | * @return VisitorResult |
||
631 | */ |
||
632 | protected function enterOperationDefinition(OperationDefinitionNode $node): VisitorResult |
||
633 | { |
||
634 | return new VisitorResult($node); |
||
635 | } |
||
636 | |||
637 | /** |
||
638 | * @param OperationDefinitionNode $node |
||
639 | * @return VisitorResult |
||
640 | */ |
||
641 | protected function leaveOperationDefinition(OperationDefinitionNode $node): VisitorResult |
||
642 | { |
||
643 | return new VisitorResult($node); |
||
644 | } |
||
645 | |||
646 | /** |
||
647 | * @param OperationTypeDefinitionNode $node |
||
648 | * @return VisitorResult |
||
649 | */ |
||
650 | protected function enterOperationTypeDefinition(OperationTypeDefinitionNode $node): VisitorResult |
||
651 | { |
||
652 | return new VisitorResult($node); |
||
653 | } |
||
654 | |||
655 | /** |
||
656 | * @param OperationTypeDefinitionNode $node |
||
657 | * @return VisitorResult |
||
658 | */ |
||
659 | protected function leaveOperationTypeDefinition(OperationTypeDefinitionNode $node): VisitorResult |
||
660 | { |
||
661 | return new VisitorResult($node); |
||
662 | } |
||
663 | |||
664 | /** |
||
665 | * @param ScalarTypeDefinitionNode $node |
||
666 | * @return VisitorResult |
||
667 | */ |
||
668 | protected function enterScalarTypeDefinition(ScalarTypeDefinitionNode $node): VisitorResult |
||
669 | { |
||
670 | return new VisitorResult($node); |
||
671 | } |
||
672 | |||
673 | /** |
||
674 | * @param ScalarTypeDefinitionNode $node |
||
675 | * @return VisitorResult |
||
676 | */ |
||
677 | protected function leaveScalarTypeDefinition(ScalarTypeDefinitionNode $node): VisitorResult |
||
678 | { |
||
679 | return new VisitorResult($node); |
||
680 | } |
||
681 | |||
682 | /** |
||
683 | * @param ScalarTypeExtensionNode $node |
||
684 | * @return VisitorResult |
||
685 | */ |
||
686 | protected function enterScalarTypeExtension(ScalarTypeExtensionNode $node): VisitorResult |
||
687 | { |
||
688 | return new VisitorResult($node); |
||
689 | } |
||
690 | |||
691 | /** |
||
692 | * @param ScalarTypeExtensionNode $node |
||
693 | * @return VisitorResult |
||
694 | */ |
||
695 | protected function leaveScalarTypeExtension(ScalarTypeExtensionNode $node): VisitorResult |
||
696 | { |
||
697 | return new VisitorResult($node); |
||
698 | } |
||
699 | |||
700 | /** |
||
701 | * @param SchemaDefinitionNode $node |
||
702 | * @return VisitorResult |
||
703 | */ |
||
704 | protected function enterSchemaDefinition(SchemaDefinitionNode $node): VisitorResult |
||
705 | { |
||
706 | return new VisitorResult($node); |
||
707 | } |
||
708 | |||
709 | /** |
||
710 | * @param SchemaDefinitionNode $node |
||
711 | * @return VisitorResult |
||
712 | */ |
||
713 | protected function leaveSchemaDefinition(SchemaDefinitionNode $node): VisitorResult |
||
714 | { |
||
715 | return new VisitorResult($node); |
||
716 | } |
||
717 | |||
718 | /** |
||
719 | * @param SchemaExtensionNode $node |
||
720 | * @return VisitorResult |
||
721 | */ |
||
722 | protected function enterSchemaExtension(SchemaExtensionNode $node): VisitorResult |
||
725 | } |
||
726 | |||
727 | /** |
||
728 | * @param SchemaExtensionNode $node |
||
729 | * @return VisitorResult |
||
730 | */ |
||
731 | protected function leaveSchemaExtension(SchemaExtensionNode $node): VisitorResult |
||
734 | } |
||
735 | |||
736 | /** |
||
737 | * @param SelectionSetNode $node |
||
738 | * @return VisitorResult |
||
739 | */ |
||
740 | protected function enterSelectionSet(SelectionSetNode $node): VisitorResult |
||
741 | { |
||
742 | return new VisitorResult($node); |
||
743 | } |
||
744 | |||
745 | /** |
||
746 | * @param SelectionSetNode $node |
||
747 | * @return VisitorResult |
||
748 | */ |
||
749 | protected function leaveSelectionSet(SelectionSetNode $node): VisitorResult |
||
750 | { |
||
751 | return new VisitorResult($node); |
||
752 | } |
||
753 | |||
754 | /** |
||
755 | * @param StringValueNode $node |
||
756 | * @return VisitorResult |
||
757 | */ |
||
758 | protected function enterStringValue(StringValueNode $node): VisitorResult |
||
759 | { |
||
760 | return new VisitorResult($node); |
||
761 | } |
||
762 | |||
763 | /** |
||
764 | * @param StringValueNode $node |
||
765 | * @return VisitorResult |
||
766 | */ |
||
767 | protected function leaveStringValue(StringValueNode $node): VisitorResult |
||
768 | { |
||
769 | return new VisitorResult($node); |
||
770 | } |
||
771 | |||
772 | /** |
||
773 | * @param UnionTypeDefinitionNode $node |
||
774 | * @return VisitorResult |
||
775 | */ |
||
776 | protected function enterUnionTypeDefinition(UnionTypeDefinitionNode $node): VisitorResult |
||
779 | } |
||
780 | |||
781 | /** |
||
782 | * @param UnionTypeDefinitionNode $node |
||
783 | * @return VisitorResult |
||
784 | */ |
||
785 | protected function leaveUnionTypeDefinition(UnionTypeDefinitionNode $node): VisitorResult |
||
786 | { |
||
787 | return new VisitorResult($node); |
||
788 | } |
||
789 | |||
790 | /** |
||
791 | * @param UnionTypeExtensionNode $node |
||
792 | * @return VisitorResult |
||
793 | */ |
||
794 | protected function enterUnionTypeExtension(UnionTypeExtensionNode $node): VisitorResult |
||
795 | { |
||
796 | return new VisitorResult($node); |
||
797 | } |
||
798 | |||
799 | /** |
||
800 | * @param UnionTypeExtensionNode $node |
||
801 | * @return VisitorResult |
||
802 | */ |
||
803 | protected function leaveUnionTypeExtension(UnionTypeExtensionNode $node): VisitorResult |
||
804 | { |
||
805 | return new VisitorResult($node); |
||
806 | } |
||
807 | |||
808 | /** |
||
809 | * @param VariableDefinitionNode $node |
||
810 | * @return VisitorResult |
||
811 | */ |
||
812 | protected function enterVariableDefinition(VariableDefinitionNode $node): VisitorResult |
||
815 | } |
||
816 | |||
817 | /** |
||
818 | * @param VariableDefinitionNode $node |
||
819 | * @return VisitorResult |
||
820 | */ |
||
821 | protected function leaveVariableDefinition(VariableDefinitionNode $node): VisitorResult |
||
822 | { |
||
823 | return new VisitorResult($node); |
||
824 | } |
||
825 | |||
826 | /** |
||
827 | * @param VariableNode $node |
||
828 | * @return VisitorResult |
||
829 | */ |
||
830 | protected function enterVariable(VariableNode $node): VisitorResult |
||
831 | { |
||
832 | return new VisitorResult($node); |
||
833 | } |
||
834 | |||
835 | /** |
||
836 | * @param VariableNode $node |
||
837 | * @return VisitorResult |
||
838 | */ |
||
839 | protected function leaveVariable(VariableNode $node): VisitorResult |
||
840 | { |
||
841 | return new VisitorResult($node); |
||
842 | } |
||
843 | } |
||
844 |