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.

LoaderManagerFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
ccs 6
cts 6
cp 1
cc 1
eloc 6
nc 1
nop 3
crap 1
1
<?php
2
namespace HtImgModule\Factory\Imagine\Loader;
3
4
use HtImgModule\Binary\MimeTypeGuesser;
5
use HtImgModule\Imagine\Filter\FilterManager;
6
use HtImgModule\Imagine\Loader\LoaderPluginManager;
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\FactoryInterface;
12
use Zend\ServiceManager\ServiceLocatorInterface;
13
use HtImgModule\Imagine\Loader\LoaderManager;
14
15
class LoaderManagerFactory 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
     * Create an object
19
     *
20
     * @param  ContainerInterface $container
21
     * @param  string             $requestedName
22
     * @param  null|array         $options
23
     *
24
     * @return object
25
     * @throws ServiceNotFoundException if unable to resolve the service.
26
     * @throws ServiceNotCreatedException if an exception is raised when
27
     *     creating a service.
28
     * @throws ContainerException if any other error occurs
29
     */
30 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
31
    {
32 1
        $filterManager      = $container->get(FilterManager::class);
33 1
        $imageLoaders       = $container->get(LoaderPluginManager::class);
34 1
        $defaultImageLoader = $container->get('HtImg\ModuleOptions')->getDefaultImageLoader();
35 1
        $mimeTypeGuesser    = $container->get(MimeTypeGuesser::class);
36
37 1
        return new LoaderManager($imageLoaders, $filterManager, $defaultImageLoader, $mimeTypeGuesser);
38
    }
39
40 1
    public function createService(ServiceLocatorInterface $serviceLocator)
41
    {
42 1
        return $this($serviceLocator, LoaderManager::class);
43
    }
44
}
45