Total Complexity | 144 |
Total Lines | 576 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Complex classes like BaseVisitor 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 BaseVisitor, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
80 | abstract class BaseVisitor implements IVisitor |
||
81 | { |
||
82 | public function startVocabularyAnnotation(IVocabularyAnnotation $annotation): void |
||
83 | { |
||
84 | } |
||
85 | |||
86 | public function endVocabularyAnnotation(IVocabularyAnnotation $annotation): void |
||
87 | { |
||
88 | } |
||
89 | |||
90 | public function startImmediateValueAnnotation(IDirectValueAnnotation $annotation): void |
||
91 | { |
||
92 | } |
||
93 | |||
94 | public function endImmediateValueAnnotation(IDirectValueAnnotation $annotation): void |
||
95 | { |
||
96 | } |
||
97 | |||
98 | public function startValueAnnotation(IValueAnnotation $annotation): void |
||
99 | { |
||
100 | } |
||
101 | |||
102 | public function endValueAnnotation(IValueAnnotation $annotation): void |
||
103 | { |
||
104 | } |
||
105 | |||
106 | public function startTypeAnnotation(ITypeAnnotation $annotation): void |
||
107 | { |
||
108 | } |
||
109 | |||
110 | public function endTypeAnnotation(ITypeAnnotation $annotation): void |
||
111 | { |
||
112 | } |
||
113 | |||
114 | public function startPropertyValueBinding(IPropertyValueBinding $binding): void |
||
115 | { |
||
116 | } |
||
117 | |||
118 | public function endPropertyValueBinding(IPropertyValueBinding $binding): void |
||
119 | { |
||
120 | } |
||
121 | |||
122 | public function startElement(IEdmElement $element): void |
||
123 | { |
||
124 | } |
||
125 | |||
126 | public function endElement(IEdmElement $element): void |
||
127 | { |
||
128 | } |
||
129 | |||
130 | public function startNamedElement(INamedElement $element): void |
||
131 | { |
||
132 | } |
||
133 | |||
134 | public function endNamedElement(INamedElement $element): void |
||
135 | { |
||
136 | } |
||
137 | |||
138 | public function startSchemaElement(ISchemaElement $element): void |
||
139 | { |
||
140 | } |
||
141 | |||
142 | public function endSchemaElement(ISchemaElement $element): void |
||
143 | { |
||
144 | } |
||
145 | |||
146 | public function startVocabularyAnnotatable(IVocabularyAnnotatable $annotatable): void |
||
147 | { |
||
148 | } |
||
149 | |||
150 | public function endVocabularyAnnotatable(IVocabularyAnnotatable $annotatable): void |
||
151 | { |
||
152 | } |
||
153 | |||
154 | public function startEntityContainer(IEntityContainer $container): void |
||
155 | { |
||
156 | } |
||
157 | |||
158 | public function endEntityContainer(IEntityContainer $container): void |
||
159 | { |
||
160 | } |
||
161 | |||
162 | public function startEntityContainerElement(IEntityContainerElement $element): void |
||
163 | { |
||
164 | } |
||
165 | |||
166 | public function endEntityContainerElement(IEntityContainerElement $element): void |
||
167 | { |
||
168 | } |
||
169 | |||
170 | public function startEntitySet(IEntitySet $set): void |
||
171 | { |
||
172 | } |
||
173 | |||
174 | public function endEntitySet(IEntitySet $set): void |
||
175 | { |
||
176 | } |
||
177 | |||
178 | public function startNavigationProperty(INavigationProperty $property): void |
||
179 | { |
||
180 | } |
||
181 | |||
182 | public function endNavigationProperty(INavigationProperty $property): void |
||
183 | { |
||
184 | } |
||
185 | |||
186 | public function startStructuralProperty(IStructuralProperty $property): void |
||
187 | { |
||
188 | } |
||
189 | |||
190 | public function endStructuralProperty(IStructuralProperty $property): void |
||
191 | { |
||
192 | } |
||
193 | |||
194 | public function startProperty(IProperty $property): void |
||
195 | { |
||
196 | } |
||
197 | |||
198 | public function endProperty(IProperty $property): void |
||
199 | { |
||
200 | } |
||
201 | |||
202 | public function startEnumMember(IEnumMember $enumMember): void |
||
203 | { |
||
204 | } |
||
205 | |||
206 | public function endEnumMember(IEnumMember $enumMember): void |
||
207 | { |
||
208 | } |
||
209 | |||
210 | public function startExpression(IExpression $expression): void |
||
211 | { |
||
212 | } |
||
213 | |||
214 | public function endExpression(IExpression $expression): void |
||
215 | { |
||
216 | } |
||
217 | |||
218 | public function startStringConstantExpression(IStringConstantExpression $expression): void |
||
219 | { |
||
220 | } |
||
221 | |||
222 | public function endStringConstantExpression(IStringConstantExpression $expression): void |
||
223 | { |
||
224 | } |
||
225 | |||
226 | public function startBinaryConstantExpression(IBinaryConstantExpression $expression): void |
||
227 | { |
||
228 | } |
||
229 | |||
230 | public function endBinaryConstantExpression(IBinaryConstantExpression $expression): void |
||
231 | { |
||
232 | } |
||
233 | |||
234 | public function startRecordExpression(IRecordExpression $expression): void |
||
235 | { |
||
236 | } |
||
237 | |||
238 | public function endRecordExpression(IRecordExpression $expression): void |
||
239 | { |
||
240 | } |
||
241 | |||
242 | public function startPropertyReferenceExpression(IPropertyReferenceExpression $expression): void |
||
243 | { |
||
244 | } |
||
245 | |||
246 | public function endPropertyReferenceExpression(IPropertyReferenceExpression $expression): void |
||
247 | { |
||
248 | } |
||
249 | |||
250 | public function startPathExpression(IPathExpression $expression): void |
||
251 | { |
||
252 | } |
||
253 | |||
254 | public function endPathExpression(IPathExpression $expression): void |
||
255 | { |
||
256 | } |
||
257 | |||
258 | public function startParameterReferenceExpression(IParameterReferenceExpression $expression): void |
||
259 | { |
||
260 | } |
||
261 | |||
262 | public function endParameterReferenceExpression(IParameterReferenceExpression $expression): void |
||
263 | { |
||
264 | } |
||
265 | |||
266 | public function startCollectionExpression(ICollectionExpression $expression): void |
||
267 | { |
||
268 | } |
||
269 | |||
270 | public function endCollectionExpression(ICollectionExpression $expression): void |
||
271 | { |
||
272 | } |
||
273 | |||
274 | public function startLabeledExpressionReferenceExpression(ILabeledExpressionReferenceExpression $expression): void |
||
275 | { |
||
276 | } |
||
277 | |||
278 | public function endLabeledExpressionReferenceExpression(ILabeledExpressionReferenceExpression $expression): void |
||
279 | { |
||
280 | } |
||
281 | |||
282 | public function startIsTypeExpression(IIsTypeExpression $expression): void |
||
283 | { |
||
284 | } |
||
285 | |||
286 | public function endIsTypeExpression(IIsTypeExpression $expression): void |
||
287 | { |
||
288 | } |
||
289 | |||
290 | public function startIntegerConstantExpression(IIntegerConstantExpression $expression): void |
||
291 | { |
||
292 | } |
||
293 | |||
294 | public function endIntegerConstantExpression(IIntegerConstantExpression $expression): void |
||
295 | { |
||
296 | } |
||
297 | |||
298 | public function startIfExpression(IIfExpression $expression): void |
||
299 | { |
||
300 | } |
||
301 | |||
302 | public function endIfExpression(IIfExpression $expression): void |
||
303 | { |
||
304 | } |
||
305 | |||
306 | public function startFunctionReferenceExpression(IFunctionReferenceExpression $expression): void |
||
307 | { |
||
308 | } |
||
309 | |||
310 | public function endFunctionReferenceExpression(IFunctionReferenceExpression $expression): void |
||
311 | { |
||
312 | } |
||
313 | |||
314 | public function startFunctionApplicationExpression(IApplyExpression $expression): void |
||
315 | { |
||
316 | } |
||
317 | |||
318 | public function endFunctionApplicationExpression(IApplyExpression $expression): void |
||
319 | { |
||
320 | } |
||
321 | |||
322 | public function startFloatingConstantExpression(IFloatingConstantExpression $expression): void |
||
323 | { |
||
324 | } |
||
325 | |||
326 | public function endFloatingConstantExpression(IFloatingConstantExpression $expression): void |
||
327 | { |
||
328 | } |
||
329 | |||
330 | public function startGuidConstantExpression(IGuidConstantExpression $expression): void |
||
331 | { |
||
332 | } |
||
333 | |||
334 | public function endGuidConstantExpression(IGuidConstantExpression $expression): void |
||
335 | { |
||
336 | } |
||
337 | |||
338 | public function startEnumMemberReferenceExpression(IEnumMemberReferenceExpression $expression): void |
||
339 | { |
||
340 | } |
||
341 | |||
342 | public function endEnumMemberReferenceExpression(IEnumMemberReferenceExpression $expression): void |
||
343 | { |
||
344 | } |
||
345 | |||
346 | public function startEntitySetReferenceExpression(IEntitySetReferenceExpression $expression): void |
||
347 | { |
||
348 | } |
||
349 | |||
350 | public function endEntitySetReferenceExpression(IEntitySetReferenceExpression $expression): void |
||
351 | { |
||
352 | } |
||
353 | |||
354 | public function startDecimalConstantExpression(IDecimalConstantExpression $expression): void |
||
355 | { |
||
356 | } |
||
357 | |||
358 | public function endDecimalConstantExpression(IDecimalConstantExpression $expression): void |
||
359 | { |
||
360 | } |
||
361 | |||
362 | public function startDateTimeConstantExpression(IDateTimeConstantExpression $expression): void |
||
363 | { |
||
364 | } |
||
365 | |||
366 | public function endDateTimeConstantExpression(IDateTimeConstantExpression $expression): void |
||
367 | { |
||
368 | } |
||
369 | |||
370 | public function startDateTimeOffsetConstantExpression(IDateTimeOffsetConstantExpression $expression): void |
||
371 | { |
||
372 | } |
||
373 | |||
374 | public function endDateTimeOffsetConstantExpression(IDateTimeOffsetConstantExpression $expression): void |
||
375 | { |
||
376 | } |
||
377 | |||
378 | public function startTimeConstantExpression(ITimeConstantExpression $expression): void |
||
379 | { |
||
380 | } |
||
381 | |||
382 | public function endTimeConstantExpression(ITimeConstantExpression $expression): void |
||
383 | { |
||
384 | } |
||
385 | |||
386 | public function startBooleanConstantExpression(IBooleanConstantExpression $expression): void |
||
387 | { |
||
388 | } |
||
389 | |||
390 | public function endBooleanConstantExpression(IBooleanConstantExpression $expression): void |
||
391 | { |
||
392 | } |
||
393 | |||
394 | public function startAssertTypeExpression(IAssertTypeExpression $expression): void |
||
395 | { |
||
396 | } |
||
397 | |||
398 | public function endAssertTypeExpression(IAssertTypeExpression $expression): void |
||
399 | { |
||
400 | } |
||
401 | |||
402 | public function startLabeledExpression(ILabeledExpression $element): void |
||
403 | { |
||
404 | } |
||
405 | |||
406 | public function endLabeledExpression(ILabeledExpression $element): void |
||
407 | { |
||
408 | } |
||
409 | |||
410 | public function startPropertyConstructor(IPropertyConstructor $constructor): void |
||
411 | { |
||
412 | } |
||
413 | |||
414 | public function endPropertyConstructor(IPropertyConstructor $constructor): void |
||
415 | { |
||
416 | } |
||
417 | |||
418 | public function startNullConstantExpression(INullExpression $expression): void |
||
419 | { |
||
420 | } |
||
421 | |||
422 | public function endNullConstantExpression(INullExpression $expression): void |
||
423 | { |
||
424 | } |
||
425 | |||
426 | public function startFunction(IFunction $function): void |
||
427 | { |
||
428 | } |
||
429 | |||
430 | public function endFunction(IFunction $function): void |
||
431 | { |
||
432 | } |
||
433 | |||
434 | public function startFunctionImport(IFunctionImport $functionImport): void |
||
435 | { |
||
436 | } |
||
437 | |||
438 | public function endFunctionImport(IFunctionImport $functionImport): void |
||
439 | { |
||
440 | } |
||
441 | |||
442 | public function startFunctionBase(IFunctionBase $functionBase): void |
||
443 | { |
||
444 | } |
||
445 | |||
446 | public function endFunctionBase(IFunctionBase $functionBase): void |
||
447 | { |
||
448 | } |
||
449 | |||
450 | public function startFunctionParameter(IFunctionParameter $parameter): void |
||
451 | { |
||
452 | } |
||
453 | |||
454 | public function endFunctionParameter(IFunctionParameter $parameter): void |
||
455 | { |
||
456 | } |
||
457 | |||
458 | public function startTerm(ITerm $term): void |
||
459 | { |
||
460 | } |
||
461 | |||
462 | public function endTerm(ITerm $term): void |
||
463 | { |
||
464 | } |
||
465 | |||
466 | public function startValueTerm(IValueTerm $term): void |
||
467 | { |
||
468 | } |
||
469 | |||
470 | public function endValueTerm(IValueTerm $term): void |
||
471 | { |
||
472 | } |
||
473 | |||
474 | public function startComplexType(IComplexType $definition): void |
||
475 | { |
||
476 | } |
||
477 | |||
478 | public function endComplexType(IComplexType $definition): void |
||
479 | { |
||
480 | } |
||
481 | |||
482 | public function startEntityType(IEntityType $definition): void |
||
483 | { |
||
484 | } |
||
485 | |||
486 | public function endEntityType(IEntityType $definition): void |
||
487 | { |
||
488 | } |
||
489 | |||
490 | public function startRowType(IRowType $definition): void |
||
491 | { |
||
492 | } |
||
493 | |||
494 | public function endRowType(IRowType $definition): void |
||
495 | { |
||
496 | } |
||
497 | |||
498 | public function startCollectionType(ICollectionType $definition): void |
||
499 | { |
||
500 | } |
||
501 | |||
502 | public function endCollectionType(ICollectionType $definition): void |
||
503 | { |
||
504 | } |
||
505 | |||
506 | public function startEnumType(IEnumType $definition): void |
||
507 | { |
||
508 | } |
||
509 | |||
510 | public function endEnumType(IEnumType $definition): void |
||
511 | { |
||
512 | } |
||
513 | |||
514 | public function startEntityReferenceType(IEntityReferenceType $definition): void |
||
515 | { |
||
516 | } |
||
517 | |||
518 | public function endEntityReferenceType(IEntityReferenceType $definition): void |
||
519 | { |
||
520 | } |
||
521 | |||
522 | public function startStructuredType(IStructuredType $definition): void |
||
523 | { |
||
524 | } |
||
525 | |||
526 | public function endStructuredType(IStructuredType $definition): void |
||
527 | { |
||
528 | } |
||
529 | |||
530 | public function startSchemaType(ISchemaType $type): void |
||
531 | { |
||
532 | } |
||
533 | |||
534 | public function endSchemaType(ISchemaType $type): void |
||
536 | } |
||
537 | |||
538 | public function startType(IType $definition): void |
||
539 | { |
||
540 | } |
||
541 | |||
542 | public function endType(IType $definition): void |
||
543 | { |
||
544 | } |
||
545 | |||
546 | public function startComplexTypeReference(IComplexTypeReference $reference): void |
||
547 | { |
||
548 | } |
||
549 | |||
550 | public function endComplexTypeReference(IComplexTypeReference $reference): void |
||
552 | } |
||
553 | |||
554 | public function startEntityTypeReference(IEntityTypeReference $reference): void |
||
555 | { |
||
556 | } |
||
557 | |||
558 | public function endEntityTypeReference(IEntityTypeReference $reference): void |
||
559 | { |
||
560 | } |
||
561 | |||
562 | public function startEntityReferenceTypeReference(IEntityReferenceTypeReference $reference): void |
||
563 | { |
||
564 | } |
||
565 | |||
566 | public function endEntityReferenceTypeReference(IEntityReferenceTypeReference $reference): void |
||
567 | { |
||
568 | } |
||
569 | |||
570 | public function startRowTypeReference(IRowTypeReference $reference): void |
||
571 | { |
||
572 | } |
||
573 | |||
574 | public function endRowTypeReference(IRowTypeReference $reference): void |
||
575 | { |
||
576 | } |
||
577 | |||
578 | public function startCollectionTypeReference(ICollectionTypeReference $reference): void |
||
580 | } |
||
581 | |||
582 | public function endCollectionTypeReference(ICollectionTypeReference $reference): void |
||
583 | { |
||
584 | } |
||
585 | |||
586 | public function startEnumTypeReference(IEnumTypeReference $reference): void |
||
587 | { |
||
588 | } |
||
589 | |||
590 | public function endEnumTypeReference(IEnumTypeReference $reference): void |
||
591 | { |
||
592 | } |
||
593 | |||
594 | public function startBinaryTypeReference(IBinaryTypeReference $reference): void |
||
595 | { |
||
596 | } |
||
597 | |||
598 | public function endBinaryTypeReference(IBinaryTypeReference $reference): void |
||
599 | { |
||
600 | } |
||
601 | |||
602 | public function startDecimalTypeReference(IDecimalTypeReference $reference): void |
||
603 | { |
||
604 | } |
||
605 | |||
606 | public function endDecimalTypeReference(IDecimalTypeReference $reference): void |
||
607 | { |
||
608 | } |
||
609 | |||
610 | public function startSpatialTypeReference(ISpatialTypeReference $reference): void |
||
611 | { |
||
612 | } |
||
613 | |||
614 | public function endSpatialTypeReference(ISpatialTypeReference $reference): void |
||
615 | { |
||
616 | } |
||
617 | |||
618 | public function startStringTypeReference(IStringTypeReference $reference): void |
||
619 | { |
||
620 | } |
||
621 | |||
622 | public function endStringTypeReference(IStringTypeReference $reference): void |
||
623 | { |
||
624 | } |
||
625 | |||
626 | public function startTemporalTypeReference(ITemporalTypeReference $reference): void |
||
627 | { |
||
628 | } |
||
629 | |||
630 | public function endTemporalTypeReference(ITemporalTypeReference $reference): void |
||
632 | } |
||
633 | |||
634 | public function startPrimitiveTypeReference(IPrimitiveTypeReference $reference): void |
||
635 | { |
||
636 | } |
||
637 | |||
638 | public function endPrimitiveTypeReference(IPrimitiveTypeReference $reference): void |
||
639 | { |
||
640 | } |
||
641 | |||
642 | public function startStructuredTypeReference(IStructuredTypeReference $reference): void |
||
643 | { |
||
644 | } |
||
645 | |||
646 | public function endStructuredTypeReference(IStructuredTypeReference $reference): void |
||
647 | { |
||
648 | } |
||
649 | |||
650 | public function startTypeReference(ITypeReference $element): void |
||
651 | { |
||
652 | } |
||
653 | |||
654 | public function endTypeReference(ITypeReference $element): void |
||
655 | { |
||
656 | } |
||
657 | } |
||
658 |