FixerSet::correct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php declare(strict_types=1);
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace FeedIo\Reader;
12
13
use FeedIo\FeedInterface;
14
15
class FixerSet
16
{
17
    protected $fixers = array();
18
19
    /**
20
     * @param \FeedIo\Reader\FixerAbstract
21
     * @return FixerSet
22
     */
23 12
    public function add(FixerAbstract $fixer) : FixerSet
24
    {
25 12
        $this->fixers[] = $fixer;
26
27 12
        return $this;
28
    }
29
30
    /**
31
     * @param  Result $result
32
     * @return FixerSet
33
     */
34 2
    public function correct(Result $result) : FixerSet
35
    {
36 2
        foreach ($this->fixers as $fixer) {
37 2
            $fixer->correct($result);
38
        }
39
40 2
        return $this;
41
    }
42
}
43