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