Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | public function getObjectFromFilename($filename) |
||
48 | { |
||
49 | /** @var ResponsiveImageRepositoryInterface $repository */ |
||
50 | $repository = $this->manager->getRepository($this->entityClassName); |
||
51 | |||
52 | if ($repository instanceof ResponsiveImageRepositoryInterface) { |
||
53 | $fileObject = $repository->findImageFromFilename($filename); |
||
54 | |||
55 | return $fileObject; |
||
56 | } |
||
57 | |||
58 | return null; |
||
59 | } |
||
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.