Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function execute() |
||
24 | { |
||
25 | /** @var \ReflectionClass $reflection */ |
||
26 | $reflection = $this->getFromResponse('reflection'); |
||
27 | $entity = $this->doctrine->getRepository($reflection->getName())->find($this->request->get('id'), 0); |
||
|
|||
28 | |||
29 | if (!$entity) { |
||
30 | throw new NotFoundHttpException('Resource not found'); |
||
31 | } |
||
32 | |||
33 | return $this->createResponse(['entity' => $entity]); |
||
34 | } |
||
41 | } |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.