1 | <?php |
||
18 | abstract class LinkedVisitor extends DynamicDispatchVisitor |
||
19 | { |
||
20 | /** |
||
21 | * @var LinkedVisitor |
||
22 | */ |
||
23 | private $next = null; |
||
24 | |||
25 | /** |
||
26 | * @var LinkedVisitor |
||
27 | */ |
||
28 | private $parent = null; |
||
29 | |||
30 | /** |
||
31 | * @param LinkedVisitor $next |
||
32 | * @param ResolverVisitorMethodInterface $resolver |
||
33 | */ |
||
34 | public function __construct( |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function canHandlerVisitee(VisiteeInterface $visitee) |
||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | public function visit(VisiteeInterface $visitee) |
||
59 | |||
60 | /** |
||
61 | * @param VisiteeInterface $visitee |
||
62 | * @param array $args |
||
63 | * @param bool $fromParent |
||
64 | */ |
||
65 | protected function doVisit(VisiteeInterface $visitee, array $args, $fromParent = false) |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | protected function notSupportedVisiteeException(VisiteeInterface $visitee) |
||
89 | } |
||
90 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.