1 | <?php |
||
18 | abstract class DynamicDispatchVisitor implements DynamicDispatchVisitorInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var \ReflectionMethod[] |
||
22 | */ |
||
23 | private $visitorMethods = null; |
||
24 | |||
25 | /** |
||
26 | * @var \ReflectionMethod[] |
||
27 | */ |
||
28 | private $handlerMethods = array(); |
||
29 | |||
30 | /** |
||
31 | * @var ResolverVisitorMethodInterface |
||
32 | */ |
||
33 | protected $resolver; |
||
34 | |||
35 | /** |
||
36 | * @param ResolverVisitorMethodInterface $resolver |
||
37 | */ |
||
38 | public function __construct(ResolverVisitorMethodInterface $resolver = null) |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | public function canHandlerVisitee(VisiteeInterface $visitee) |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function visit(VisiteeInterface $visitee) |
||
58 | |||
59 | /** |
||
60 | * @param VisiteeInterface $visitee |
||
61 | * @param array $args |
||
62 | * |
||
63 | * @return mixed |
||
64 | */ |
||
65 | protected function visitWith(VisiteeInterface $visitee, array $args) |
||
75 | |||
76 | /** |
||
77 | * @param VisiteeInterface $visitee |
||
78 | * |
||
79 | * @return \LogicException |
||
80 | */ |
||
81 | protected function notSupportedVisiteeException(VisiteeInterface $visitee) |
||
87 | |||
88 | /** |
||
89 | * @param VisiteeInterface $visitee |
||
90 | * |
||
91 | * @return \ReflectionMethod|null |
||
92 | */ |
||
93 | private function handlerMethod(VisiteeInterface $visitee) |
||
105 | |||
106 | /** |
||
107 | * @param \ReflectionClass $class |
||
108 | * |
||
109 | * @return \ReflectionMethod|null |
||
110 | */ |
||
111 | private function findHandlerMethod(\ReflectionClass $class) |
||
126 | |||
127 | /** |
||
128 | * @return \ReflectionMethod[] |
||
129 | */ |
||
130 | private function visitorMethods() |
||
146 | } |
||
147 |