| Conditions | 4 |
| Paths | 5 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function scanAction() |
||
| 34 | { |
||
| 35 | $pages = $this->getDoctrine() |
||
| 36 | ->getRepository($this->params->get('pwc.entity_page')) |
||
| 37 | ->findAll(); |
||
| 38 | |||
| 39 | $errors = []; |
||
| 40 | $errorNbr = 0; |
||
| 41 | |||
| 42 | foreach ($pages as $page) { |
||
| 43 | // todo import scanner via setScanner + services.yaml |
||
| 44 | $scan = $this->scanner->scan($page); |
||
| 45 | if (true !== $scan) { |
||
| 46 | $errors[$page->getId()] = $scan; |
||
| 47 | $errorNbr = $errorNbr + \count($errors[$page->getId()]); |
||
| 48 | } |
||
| 49 | |||
| 50 | if ($errorNbr > 100) { |
||
| 51 | break; |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 55 | return $this->render('@pwcPageScanner/results.html.twig', [ |
||
| 56 | 'errorsByPages' => $errors, |
||
| 57 | ]); |
||
| 60 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.