Select Git revision
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
SupportedPHPVersions.php 832 B
<?php
namespace Studip\Dockerized;
final class SupportedPHPVersions
{
private const CONFIGURATION = [
'7.2' => [8072, 8872],
'7.3' => [8073, 8873],
'7.4' => [8074, 8874],
'8.0' => [8080, 8880],
'8.1' => [8081, 8881],
'8.2' => [8082, 8882],
'8.3' => [8083, 8883],
];
private const DEFAULT = ['7.4', '8.1', '8.3'];
public static function getVersions(): array
{
return array_keys(self::CONFIGURATION);
}
public static function getDefaultVersions(): array
{
return self::DEFAULT;
}
public static function mapPort(string $version): int
{
if (!isset(self::CONFIGURATION[$version])) {
throw new \Exception('Unsupported php version');
}
return self::CONFIGURATION[$version];
}
}