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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 3
dl 0
loc 39
rs 10
c 0
b 0
f 0
ccs 13
cts 13
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
B load() 0 20 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