Completed
Push — master ( 58523e...56a418 )
by greg
37:25 queued 34:17
created

MissionGameFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
namespace PlaygroundGame\Service\Factory;
3
4
use PlaygroundGame\Service\MissionGame;
5
use Zend\ServiceManager\Factory\FactoryInterface;
6
use Interop\Container\ContainerInterface;
7
8
class MissionGameFactory implements FactoryInterface
9
{
10
    public function __invoke(ContainerInterface $container, $requestedName, $options = null)
11
    {
12
        $service = new MissionGame($container);
0 ignored issues
show
Compatibility introduced by
$container of type object<Interop\Container\ContainerInterface> is not a sub-type of object<Zend\ServiceManag...erviceLocatorInterface>. It seems like you assume a child interface of the interface Interop\Container\ContainerInterface to be always present.

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.

Loading history...
13
14
        return $service;
15
    }
16
}
17