Skip to content

Commit 181777f

Browse files
committed
rename methods
1 parent 1c49091 commit 181777f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/Analyser/ConstantResolver.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
8888
$maxMajor = null;
8989

9090
if ($this->composerMinPhpVersion !== null) {
91-
$minMajor = max($minMajor, $this->composerMinPhpVersion->getMajor());
91+
$minMajor = max($minMajor, $this->composerMinPhpVersion->getMajorVersionId());
9292
}
9393
if ($this->composerMaxPhpVersion !== null) {
94-
$maxMajor = $this->composerMaxPhpVersion->getMajor();
94+
$maxMajor = $this->composerMaxPhpVersion->getMajorVersionId();
9595
}
9696

9797
return $this->createInteger($minMajor, $maxMajor);
@@ -103,10 +103,10 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
103103
if (
104104
$this->composerMinPhpVersion !== null
105105
&& $this->composerMaxPhpVersion !== null
106-
&& $this->composerMaxPhpVersion->getMajor() === $this->composerMinPhpVersion->getMajor()
106+
&& $this->composerMaxPhpVersion->getMajorVersionId() === $this->composerMinPhpVersion->getMajorVersionId()
107107
) {
108-
$minMinor = $this->composerMinPhpVersion->getMinor();
109-
$maxMinor = $this->composerMaxPhpVersion->getMinor();
108+
$minMinor = $this->composerMinPhpVersion->getMinorVersionId();
109+
$maxMinor = $this->composerMaxPhpVersion->getMinorVersionId();
110110
}
111111

112112
return $this->createInteger($minMinor, $maxMinor);
@@ -118,11 +118,11 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
118118
if (
119119
$this->composerMinPhpVersion !== null
120120
&& $this->composerMaxPhpVersion !== null
121-
&& $this->composerMaxPhpVersion->getMajor() === $this->composerMinPhpVersion->getMajor()
122-
&& $this->composerMaxPhpVersion->getMinor() === $this->composerMinPhpVersion->getMinor()
121+
&& $this->composerMaxPhpVersion->getMajorVersionId() === $this->composerMinPhpVersion->getMajorVersionId()
122+
&& $this->composerMaxPhpVersion->getMinorVersionId() === $this->composerMinPhpVersion->getMinorVersionId()
123123
) {
124-
$minRelease = $this->composerMinPhpVersion->getPatch();
125-
$maxRelease = $this->composerMaxPhpVersion->getPatch();
124+
$minRelease = $this->composerMinPhpVersion->getPatchVersionId();
125+
$maxRelease = $this->composerMaxPhpVersion->getPatchVersionId();
126126
}
127127

128128
return $this->createInteger($minRelease, $maxRelease);

src/Php/PhpVersion.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ public function getVersionId(): int
4141
return $this->versionId;
4242
}
4343

44-
public function getMajor(): int
44+
public function getMajorVersionId(): int
4545
{
4646
return (int) floor($this->versionId / 10000);
4747
}
4848

49-
public function getMinor(): int
49+
public function getMinorVersionId(): int
5050
{
5151
return (int) floor(($this->versionId % 10000) / 100);
5252
}
5353

54-
public function getPatch(): int
54+
public function getPatchVersionId(): int
5555
{
5656
return (int) floor($this->versionId % 100);
5757
}
5858

5959
public function getVersionString(): string
6060
{
61-
$first = $this->getMajor();
62-
$second = $this->getMinor();
63-
$third = $this->getPatch();
61+
$first = $this->getMajorVersionId();
62+
$second = $this->getMinorVersionId();
63+
$third = $this->getPatchVersionId();
6464

6565
return $first . '.' . $second . ($third !== 0 ? '.' . $third : '');
6666
}

0 commit comments

Comments
 (0)