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

Chain::load()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 20
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 5

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 8.8571
c 0
b 0
f 0
ccs 10
cts 10
cp 1
cc 5
eloc 10
nc 4
nop 1
crap 5
1
<?php
2
namespace HtImgModule\Imagine\Filter\Loader;
3
4
use HtImgModule\Exception;
5
use HtImgModule\Imagine\Filter\Chain as ChainFilter;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
8
class Chain implements LoaderInterface
9
{
10
    /**
11
     * @var ServiceLocatorInterface
12
     */
13
    protected $filterLoaders;
14
15
    /**
16
     * @param ServiceLocatorInterface $filterLoaders
17
     */
18 4
    public function __construct(ServiceLocatorInterface $filterLoaders)
19
    {
20 4
        $this->filterLoaders = $filterLoaders;
21 4
    }
22
23
    /**
24
     * {@inheritDoc}
25
     */
26 3
    public function load(array $options = [])
27
    {
28 3
        if (false == isset($options['filters']) || false == is_array($options['filters'])) {
0 ignored issues
show
Coding Style Best Practice introduced by
It seems like you are loosely comparing two booleans. Considering using the strict comparison === instead.

When comparing two booleans, it is generally considered safer to use the strict comparison operator.

Loading history...
29 1
            throw new Exception\InvalidArgumentException('Expected filters key and type of array');
30
        }
31
32 2
        if (false == $options['filters']) {
33 1
            throw new Exception\InvalidArgumentException('At least one filter expected');
34
        }
35
36 1
        $filters = [];
37
38 1
        foreach ($options['filters'] as $loaderName => $loaderOptions) {
39 1
            $loader = $this->filterLoaders->get($loaderName);
40 1
            $filters[] = $loader->load($loaderOptions);
41
        }
42
43 1
        return new ChainFilter($filters);
44
45
    }
46
}
47