@@ 133-148 (lines=16) @@ | ||
130 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
|
131 | * @throws \Assert\AssertionFailedException |
|
132 | */ |
|
133 | private function getExtractor(ServiceLocatorInterface $container, $service) |
|
134 | { |
|
135 | if ($service instanceof ExtractionInterface) { |
|
136 | return $service; |
|
137 | } |
|
138 | ||
139 | if ($service === null) { |
|
140 | return new ClassMethods(); |
|
141 | } |
|
142 | ||
143 | $extractor = $this->getService($container, $service, 'HydratorManager'); |
|
144 | Assertion::isInstanceOf($extractor, ExtractionInterface::class); |
|
145 | ||
146 | /** @var ExtractionInterface $extractor */ |
|
147 | return $extractor; |
|
148 | } |
|
149 | ||
150 | /** |
|
151 | * @param ServiceLocatorInterface $container |
|
@@ 157-172 (lines=16) @@ | ||
154 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
|
155 | * @throws \Assert\AssertionFailedException |
|
156 | */ |
|
157 | private function getHydrator(ServiceLocatorInterface $container, $service) |
|
158 | { |
|
159 | if ($service instanceof HydrationInterface) { |
|
160 | return $service; |
|
161 | } |
|
162 | ||
163 | if ($service === null) { |
|
164 | return new ClassMethods(); |
|
165 | } |
|
166 | ||
167 | $validator = $this->getService($container, $service, 'HydratorManager'); |
|
168 | Assertion::isInstanceOf($validator, HydrationInterface::class); |
|
169 | ||
170 | /** @var HydrationInterface $validator */ |
|
171 | return $validator; |
|
172 | } |
|
173 | ||
174 | /** |
|
175 | * @param ServiceLocatorInterface $container |