Skip to content

Commit 19b94c9

Browse files
committed
append _85
1 parent be0c352 commit 19b94c9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/step/CreatePackages.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,16 @@ private static function createGenericPackage(string $name): void
8787
try {
8888
$pkg = new $packageClass();
8989
if (method_exists($pkg, 'getVersion')) {
90-
$ver = $pkg->getVersion();
91-
if (is_string($ver) && $ver !== '') {
92-
$pkgVersion = $ver;
90+
$pkgVersion = $pkg->getVersion();
91+
if ($pkgVersion !== $phpVersion) {
92+
// Extract major and minor version numbers from PHP version
93+
if (preg_match('/^(\d+)\.(\d+)/', $phpVersion, $matches)) {
94+
$majorMinor = $matches[1] . $matches[2]; // Combine major and minor without dot
95+
$pkgVersion .= '_' . $majorMinor;
96+
}
97+
else {
98+
throw new \RuntimeException("Warning: Could not extract major.minor from PHP version: {$phpVersion}");
99+
}
93100
}
94101
}
95102
} catch (\Throwable) {

0 commit comments

Comments
 (0)