Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
35 | public function resolve($handler) |
||
36 | { |
||
37 | // Only attempt to resolve uninstantiated objects. |
||
38 | if (is_array($handler) && is_string($handler[0])) { |
||
39 | // Retrieve the route handler class from the dependency injection |
||
40 | // container. This ensures that the instantiated handler class |
||
41 | // receives all of the correct dependencies. |
||
42 | $handler_object = $this->container->get($handler[0]); |
||
43 | |||
44 | // Manually set the response and request dependencies. |
||
45 | $handler_object->setRequest($this->container->get('Symfony\Component\HttpFoundation\Request')); |
||
46 | $handler_object->setResponse($this->container->get('Symfony\Component\HttpFoundation\Response')); |
||
47 | |||
48 | // Pass the object back. |
||
49 | $handler[0] = $handler_object; |
||
50 | } |
||
51 | |||
52 | return $handler; |
||
53 | } |
||
54 | } |
||
55 |