| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.032 |
| Changes | 0 | ||
| 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 | ); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |