| 1 | <?php |
||
| 11 | class DoctrineFactory implements Factory |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var ManagerRegistry |
||
| 15 | */ |
||
| 16 | private $managerRegistry; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param ManagerRegistry $managerRegistry |
||
| 20 | */ |
||
| 21 | public function __construct(ManagerRegistry $managerRegistry) |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param PersistenceContext $context |
||
| 28 | * @return Doctrine\ODMTransaction|Doctrine\ORMTransaction |
||
| 29 | * @throws UnsupportedManagerException |
||
| 30 | */ |
||
| 31 | public function create(PersistenceContext $context) |
||
| 44 | } |
||
| 45 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.