| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 16 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | View Code Duplication | public function contactsAction() |
|
| 31 | { |
||
| 32 | $pageHelper = new PageHelper(); |
||
| 33 | $pageResult = $pageHelper->pageBySlug('contacts'); |
||
| 34 | if (!$pageResult) { |
||
| 35 | throw new Exception("Page 'contacts' not found"); |
||
| 36 | } |
||
| 37 | |||
| 38 | $this->helper->title()->append($pageResult->meta_title); |
||
| 39 | $this->helper->meta()->set('description', $pageResult->meta_description); |
||
| 40 | $this->helper->meta()->set('keywords', $pageResult->meta_keywords); |
||
| 41 | |||
| 42 | $this->helper->menu->setActive('contacts'); |
||
| 43 | |||
| 44 | $this->view->text = $pageResult->text; |
||
| 45 | } |
||
| 46 | |||
| 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: