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