| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function getAction() |
||
| 20 | { |
||
| 21 | //get entity from storage |
||
| 22 | $pageId = (int) $this->request->getQuery('pageId'); |
||
| 23 | $page = \Page\Model\Page::findFirst($pageId); |
||
| 24 | if (!$pageId || !$page) { |
||
| 25 | return $this->render(new \Api\Model\Payload(null, sprintf('Page with id: %s was not found.', $pageId))); |
||
|
|
|||
| 26 | } |
||
| 27 | |||
| 28 | //filter required data for display |
||
| 29 | $filter = new \Api\Filter\Page(); |
||
| 30 | $payload = new \Api\Model\Payload($filter->filter($page)); |
||
| 31 | |||
| 32 | return $this->render($payload); |
||
| 33 | } |
||
| 34 | |||
| 50 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: