| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | final public function compareTo($other): int |
||
| 18 | { |
||
| 19 | if ($other === null) { |
||
| 20 | throw new \InvalidArgumentException('comparing with null'); |
||
| 21 | } elseif (get_class($this) == get_class($other)) { |
||
| 22 | return ($this <=> $other); |
||
| 23 | } else { |
||
| 24 | throw new IncomparableException(); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 |