Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
21 | { |
||
22 | if ($serviceLocator instanceof AbstractPluginManager) { |
||
23 | $serviceLocator = $serviceLocator->getServiceLocator(); |
||
24 | } |
||
25 | $config = $serviceLocator->get('Config'); |
||
26 | $migrationConfig = $config['migrations']; |
||
27 | |||
28 | $adapterName = isset($migrationConfig['adapter']) ? $migrationConfig['adapter'] : 'Zend\Db\Adapter\Adapter'; |
||
29 | /** @var $adapter \Zend\Db\Adapter\Adapter */ |
||
30 | $adapter = $serviceLocator->get($adapterName); |
||
31 | |||
32 | $resultSetPrototype = new ResultSet(); |
||
33 | $resultSetPrototype->setArrayObjectPrototype(new Version()); |
||
|
|||
34 | |||
35 | return new TableGateway(Version::TABLE_NAME, $adapter, null, $resultSetPrototype); |
||
36 | } |
||
37 | } |
||
38 |
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: