Completed
Pull Request — master (#8)
by
unknown
15:43
created

ClassnameZendLocatorFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
1
<?php
2
3
namespace TacticianModule\Locator;
4
5
use Interop\Container\ContainerInterface;
6
use Zend\ServiceManager\Factory\FactoryInterface;
7
8
class ClassnameZendLocatorFactory implements FactoryInterface
9
{
10
    /**
11
     * Create service
12
     *
13
     * @param ContainerInterface $container
14
     * @param string $requestedName
15
     * @param array $options
16
     * @return ClassnameZendLocator
17
     */
18
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
19
    {
20
        return new ClassnameZendLocator($container);
1 ignored issue
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...
21
    }
22
}
23