CleanerCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A clear() 0 4 2
A addCleaner() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\Cleaner;
6
7
class CleanerCollection implements CleanerInterface
8
{
9
    /**
10
     * @var CleanerInterface[]
11
     */
12
    private $cleaners = [];
13
14 2
    public function addCleaner(CleanerInterface $cleaner): self
15
    {
16 2
        $this->cleaners[] = $cleaner;
17
18 2
        return $this;
19
    }
20
21 2
    public function clear(): void
22
    {
23 2
        foreach ($this->cleaners as $cleaner) {
24 2
            $cleaner->clear();
25
        }
26 1
    }
27
}
28