| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function indexAction() |
||
| 14 | { |
||
| 15 | $slug = $this->dispatcher->getParam('slug', 'string'); |
||
|
|
|||
| 16 | |||
| 17 | $pageHelper = new PageHelper(); |
||
| 18 | $pageResult = $pageHelper->pageBySlug($slug); |
||
| 19 | if (!$pageResult) { |
||
| 20 | throw new Exception("Page '$slug.html' not found"); |
||
| 21 | } |
||
| 22 | |||
| 23 | $this->helper->title()->append($pageResult->meta_title); |
||
| 24 | $this->helper->meta()->set('description', $pageResult->meta_description); |
||
| 25 | $this->helper->meta()->set('keywords', $pageResult->meta_keywords); |
||
| 26 | |||
| 27 | $this->view->text = $pageResult->text; |
||
| 28 | } |
||
| 29 | |||
| 48 |
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: