ComparatorCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A equal() 0 3 1
A greater() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\JSON\Path\Runtime;
6
7
use Collator;
8
use Remorhaz\JSON\Data\Comparator\ComparatorInterface;
9
use Remorhaz\JSON\Data\Comparator\EqualValueComparator;
10
use Remorhaz\JSON\Data\Comparator\GreaterValueComparator;
11
12
final class ComparatorCollection implements ComparatorCollectionInterface
13
{
14
15
    private $collator;
16
17 4
    public function __construct(Collator $collator)
18
    {
19 4
        $this->collator = $collator;
20 4
    }
21
22 2
    public function equal(): ComparatorInterface
23
    {
24 2
        return new EqualValueComparator($this->collator);
25
    }
26
27 2
    public function greater(): ComparatorInterface
28
    {
29 2
        return new GreaterValueComparator($this->collator);
30
    }
31
}
32