| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function playAction() |
||
| 12 | { |
||
| 13 | $entry = $this->getGameService()->play($this->game, $this->user); |
||
| 14 | $viewModel = $this->buildView($this->game); |
||
| 15 | $booster = null; |
||
| 16 | if ($entry) { |
||
| 17 | $booster = $this->getGameService()->getBooster($this->game, $this->user, $entry); |
||
| 18 | } |
||
| 19 | |||
| 20 | $album = $this->getGameService()->getAlbum($this->game, $this->user); |
||
| 21 | $viewModel->setVariables(array('booster' => $booster, 'album' => $album)); |
||
|
|
|||
| 22 | |||
| 23 | return $viewModel; |
||
| 24 | } |
||
| 25 | |||
| 44 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: