Total Complexity | 4 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class ValueObject implements Comparable |
||
10 | { |
||
11 | 26 | public function __construct(private Collator $collator, private string $methodOrPropertyName, private bool $isProperty) |
|
13 | 26 | } |
|
14 | |||
15 | 24 | public function compare(mixed $value, mixed $comparativeValue): int |
|
16 | { |
||
17 | 24 | return $this->collator->compare( |
|
18 | 24 | $this->callAccessor((object) $value), |
|
19 | 24 | $this->callAccessor((object) $comparativeValue), |
|
20 | 24 | ); |
|
21 | } |
||
22 | |||
23 | 24 | private function callAccessor(object $valueObject): mixed |
|
30 | } |
||
31 | } |
||
32 |