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.
Completed
Push — master ( 037104...b3593d )
by
unknown
10s
created

SimpleFileSystemLoaderFactory::__invoke()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
ccs 4
cts 4
cp 1
cc 2
eloc 4
nc 2
nop 3
crap 2
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\SimpleFileSystemLoader;
11
use HtImgModule\Exception;
12
13
class SimpleFileSystemLoaderFactory 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...
14
{
15
    /**
16
     * @var array
17
     */
18
    protected $options = [];
19
20
    /**
21
     * {@inheritDoc}
22
     */
23 1
    public function setCreationOptions(array $options)
24
    {
25 1
        $this->options = $options;
26 1
    }
27
28
    /**
29
     * Create an object
30
     *
31
     * @param  ContainerInterface $container
32
     * @param  string             $requestedName
33
     * @param  null|array         $options
34
     *
35
     * @return object
36
     * @throws ServiceNotFoundException if unable to resolve the service.
37
     * @throws ServiceNotCreatedException if an exception is raised when
38
     *     creating a service.
39
     * @throws ContainerException if any other error occurs
40
     */
41 2
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
42
    {
43 2
        if (!isset($options['root_path'])) {
44 1
            throw new Exception\InvalidArgumentException('Missing "root_path" in options array');
45
        }
46
47 1
        return new SimpleFileSystemLoader($options['root_path']);
48
    }
49
50 2
    public function createService(ServiceLocatorInterface $loaders)
51
    {
52 2
        return $this($loaders, SimpleFileSystemLoader::class, $this->options);
53
    }
54
}
55