GeoipFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace ZfSnapGeoip\Service;
4
5
use Interop\Container\ContainerInterface;
6
7
final class GeoipFactory
8
{
9
    public function __invoke(ContainerInterface $container)
10
    {
11
        return new Geoip($container);
0 ignored issues
show
Compatibility introduced by
$container of type object<Interop\Container\ContainerInterface> is not a sub-type of object<Zend\ServiceManager\ServiceManager>. It seems like you assume a concrete implementation 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...
12
    }
13
}
14