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.

FileSystemLoaderFactory   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 30
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createService() 0 4 1
A __invoke() 0 9 3
1
<?php
2
namespace HtImgModule\Factory\Imagine\Loader;
3
4
use Interop\Container\ContainerInterface;
5
use Interop\Container\Exception\ContainerException;
6
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
7
use Zend\ServiceManager\Exception\ServiceNotFoundException;
8
use Zend\ServiceManager\FactoryInterface;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
use HtImgModule\Imagine\Loader\FileSystemLoader;
11
12
class FileSystemLoaderFactory 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...
13
{
14
    /**
15
     * Create an object
16
     *
17
     * @param  ContainerInterface $container
18
     * @param  string             $requestedName
19
     * @param  null|array         $options
20
     *
21
     * @return object
22
     * @throws ServiceNotFoundException if unable to resolve the service.
23
     * @throws ServiceNotCreatedException if an exception is raised when
24
     *     creating a service.
25
     * @throws ContainerException if any other error occurs
26
     */
27 1
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
28
    {
29
        // For v2, we need to pull the parent service locator
30 1
        if (!method_exists($container, 'configure')) {
31
            $container = $container->getServiceLocator() ?: $container;
32
        }
33
34 1
        return new FileSystemLoader($container->get('HtImg\RelativePathResolver'));
35
    }
36
37 1
    public function createService(ServiceLocatorInterface $loaders)
38
    {
39 1
        return $this($loaders, FileSystemLoader::class);
40
    }
41
}
42