GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ImgUrlFactory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0
ccs 0
cts 15
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 12 2
A createService() 0 4 1
1
<?php
2
namespace HtImgModule\View\Helper\Factory;
3
4
use HtImgModule\Imagine\Filter\FilterManager;
5
use HtImgModule\Imagine\Loader\LoaderManager;
6
use HtImgModule\Service\CacheManager;
7
use Interop\Container\ContainerInterface;
8
use Interop\Container\Exception\ContainerException;
9
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
10
use Zend\ServiceManager\Exception\ServiceNotFoundException;
11
use Zend\ServiceManager\ServiceLocatorInterface;
12
use Zend\ServiceManager\FactoryInterface;
13
use HtImgModule\View\Helper\ImgUrl;
14
15
class ImgUrlFactory implements FactoryInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Zend\ServiceManager\FactoryInterface has been deprecated with message: Use Zend\ServiceManager\Factory\FactoryInterface instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
16
{
17
18
    /**
19
     * Create an object
20
     *
21
     * @param  ContainerInterface $container
22
     * @param  string             $requestedName
23
     * @param  null|array         $options
24
     *
25
     * @return object
26
     * @throws ServiceNotFoundException if unable to resolve the service.
27
     * @throws ServiceNotCreatedException if an exception is raised when
28
     *     creating a service.
29
     * @throws ContainerException if any other error occurs
30
     */
31
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
32
    {
33
        if (!method_exists($container, 'configure')) {
34
            $container = $container->getServiceLocator();
35
        }
36
37
        return new ImgUrl(
38
            $container->get(CacheManager::class),
39
            $container->get(FilterManager::class),
40
            $container->get(LoaderManager::class)
41
        );
42
    }
43
44
    public function createService(ServiceLocatorInterface $helpers)
45
    {
46
        return $this($helpers, ImgUrl::class);
47
    }
48
}
49