Total Complexity | 11 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | final class GreaterValueComparator implements ComparatorInterface |
||
14 | { |
||
15 | |||
16 | private $collator; |
||
17 | |||
18 | public function __construct(Collator $collator) |
||
19 | { |
||
20 | $this->collator = $collator; |
||
21 | } |
||
22 | |||
23 | public function compare(ValueInterface $leftValue, ValueInterface $rightValue): bool |
||
24 | { |
||
25 | if ($leftValue instanceof ScalarValueInterface && $rightValue instanceof ScalarValueInterface) { |
||
26 | return $this->isScalarGreater($leftValue, $rightValue); |
||
27 | } |
||
28 | |||
29 | return false; |
||
30 | } |
||
31 | |||
32 | private function isScalarGreater(ScalarValueInterface $leftValue, ScalarValueInterface $rightValue): bool |
||
45 | } |
||
46 | } |
||
47 |