Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2.032 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
30 | 2 | protected function buildController() |
|
31 | { |
||
32 | 2 | $controllerNames = $this->getCommand()->getActionParam('class'); |
|
33 | 2 | $controller = ClassResolver::resolveFromClasses($controllerNames); |
|
34 | |||
35 | 2 | if ($controller) { |
|
36 | 2 | ResolverCache::setFromAction($this->getCommand()->getAction(), get_class($controller)); |
|
37 | 2 | ResolverCache::save(); |
|
38 | 2 | $this->getCommand()->setActionParam('instance', $controller); |
|
39 | 2 | return; |
|
40 | } |
||
41 | |||
42 | throw new InvalidCommandException( |
||
43 | "No valid controllers found for [" . print_r($controllerNames, true) . "]" |
||
|
|||
44 | ); |
||
47 |