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
Pull Request — master (#34)
by
unknown
04:00 queued 02:11
created

Chain::apply()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
namespace HtImgModule\Imagine\Filter;
3
4
use Imagine\Filter\FilterInterface;
5
use Imagine\Image\ImageInterface;
6
use HtImgModule\Exception;
7
8
class Chain implements FilterInterface
9
{
10
11
    /**
12
     * @var \Imagine\Filter\FilterInterface[]
13
     */
14
    protected $filters;
15
16
    /**
17
     * @param \Imagine\Filter\FilterInterface[] $filters
18
     *
19
     * @throws Exception\InvalidArgumentException
20
     */
21 3
    public function __construct(array $filters)
22
    {
23 3
        foreach ($filters as $filter) {
24 3
            if (!$filter instanceof FilterInterface) {
25 1
                throw new Exception\InvalidArgumentException('Instance of Imagine\\Filter\\FilterInterface expected');
26
            }
27 2
        }
28
29 2
        $this->filters = $filters;
30 2
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35 1
    public function apply(ImageInterface $image)
36
    {
37
        /** @var $filter \Imagine\Filter\FilterInterface */
38 1
        foreach ($this->filters as $filter) {
39 1
            $image = $filter->apply($image);
40 1
        }
41
42 1
        return $image;
43
    }
44
}
45