Skip to content

Commit 81dd82c

Browse files
committed
make PhpCompatUtil::getPhpVersion() public
1 parent 203699d commit 81dd82c

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/Util/PhpCompatUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function canUseTypedProperties(): bool
4343
return version_compare($version, '7.4', '>=');
4444
}
4545

46-
protected function getPhpVersion(): string
46+
public function getPhpVersion(): string
4747
{
4848
$rootDirectory = $this->fileManager->getRootDirectory();
4949

tests/Util/PhpVersionTest.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ public function testFallBackToPhpVersionWithoutLockFile(): void
101101
->method('getFileContents')
102102
;
103103

104-
$util = new PhpCompatUtilTestFixture($mockFileManager);
104+
$util = new PhpCompatUtil($mockFileManager);
105105

106-
$result = $util->getVersionForTest();
106+
$result = $util->getPhpVersion();
107107

108108
self::assertSame(\PHP_VERSION, $result);
109109
}
@@ -133,9 +133,9 @@ public function testWithoutPlatformVersionSet(): void
133133
->willReturn($json)
134134
;
135135

136-
$util = new PhpCompatUtilTestFixture($mockFileManager);
136+
$util = new PhpCompatUtil($mockFileManager);
137137

138-
$result = $util->getVersionForTest();
138+
$result = $util->getPhpVersion();
139139

140140
self::assertSame(\PHP_VERSION, $result);
141141
}
@@ -187,11 +187,3 @@ public function phpVersionForTypedPropertiesDataProvider(): \Generator
187187
yield ['5.7', false];
188188
}
189189
}
190-
191-
class PhpCompatUtilTestFixture extends PhpCompatUtil
192-
{
193-
public function getVersionForTest(): string
194-
{
195-
return $this->getPhpVersion();
196-
}
197-
}

0 commit comments

Comments
 (0)