Passed
Push — master ( b4dbcd...f875e6 )
by Edward
05:05
created

ComparatorCollection   A

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