Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
14 | { |
||
15 | /** @var Config $config */ |
||
16 | $config = $serviceLocator->get(Config::class); |
||
17 | |||
18 | $adapterName = $config->getAdapter(); |
||
19 | /** @var $adapter \Zend\Db\Adapter\Adapter */ |
||
20 | $adapter = $serviceLocator->get($adapterName); |
||
21 | |||
22 | $resultSetPrototype = new ResultSet(); |
||
23 | $resultSetPrototype->setArrayObjectPrototype(new Version()); |
||
|
|||
24 | |||
25 | return new TableGateway(Version::TABLE_NAME, $adapter, null, $resultSetPrototype); |
||
26 | } |
||
27 | } |
||
28 |
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: