| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 2 | public function registerViewComponents( |
|
| 25 | ModuleViewEnum $view, |
||
| 26 | GameControllerInterface $game |
||
| 27 | ): void { |
||
| 28 | |||
| 29 | 2 | if (!array_key_exists($view->value, $this->viewComponentProviders)) { |
|
| 30 | 1 | throw new RuntimeException(sprintf('viewComponentProvider with follwing id does not exist: %s', $view->value)); |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | $game->appendNavigationPart( |
|
| 34 | 1 | $view->getPhpPage(), |
|
| 35 | 1 | $view->getTitle(), |
|
| 36 | 1 | ); |
|
| 37 | |||
| 38 | 1 | $componentProvider = $this->viewComponentProviders[$view->value]; |
|
| 39 | 1 | $componentProvider->setTemplateVariables($game); |
|
| 40 | |||
| 41 | 1 | $game->setTemplateVar('CURRENT_VIEW', $view); |
|
| 42 | } |
||
| 44 |