Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
30 | public function extractAnnotations(array $routes, $view = 'default') |
||
31 | { |
||
32 | foreach ($routes as &$route) { |
||
33 | if (!$route instanceof Route) { |
||
34 | throw new \InvalidArgumentException(sprintf('All elements of $routes must be instances of Route. "%s" given', gettype($route))); |
||
35 | } |
||
36 | |||
37 | if (!$route->getDefault('_defaultHandler')) { |
||
38 | $route = clone $route; |
||
39 | |||
40 | $parameters = new ParameterBag($route->getDefaults()); |
||
41 | $route->setDefault('_controller', \Controller::getController($parameters)->getAction()); |
||
42 | } |
||
43 | } |
||
44 | |||
45 | return parent::extractAnnotations($routes); |
||
46 | } |
||
47 | |||
63 |