| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | 36 | public function compare(Version $version1, Version $version2): int |
|
| 12 | { |
||
| 13 | 36 | if (0 !== ($majorCompareResult = ($version1->getMajor() <=> $version2->getMajor()))) { |
|
| 14 | 10 | return $majorCompareResult; |
|
| 15 | } |
||
| 16 | |||
| 17 | 31 | if (0 !== ($minorCompareResult = ($version1->getMinor() <=> $version2->getMinor()))) { |
|
| 18 | 6 | return $minorCompareResult; |
|
| 19 | } |
||
| 20 | |||
| 21 | 27 | if (0 !== ($patchCompareResult = ($version1->getPatch() <=> $version2->getPatch()))) { |
|
| 22 | 6 | return $patchCompareResult; |
|
| 23 | } |
||
| 24 | |||
| 25 | 23 | return $this->compareMeta($version1, $version2); |
|
| 26 | } |
||
| 27 | |||
| 42 |