Passed
Pull Request — master (#19)
by Jakub
02:59
created

Filter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 18
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Zalas\Toolbox\Tool;
4
5
class Filter
6
{
7
    /**
8
     * @var string[]
9
     */
10
    private $excludedTags;
11
12
    /**
13
     * @param string[] $excludedTags
14
     */
15 35
    public function __construct(array $excludedTags)
16
    {
17 35
        $this->excludedTags = $excludedTags;
18
    }
19
20 11
    public function __invoke(Tool $tool): bool
21
    {
22 11
        return $this->excludedTags === \array_diff($this->excludedTags, $tool->tags());
23
    }
24
}
25