Skip to content
Snippets Groups Projects
Select Git revision
  • c8da48845c56af15fa0a183526bf056681507507
  • main default protected
  • studip-rector
  • ci-opt
  • course-members-export-as-word
  • data-vue-app
  • pipeline-improvements
  • webpack-optimizations
  • rector
  • icon-renewal
  • http-client-and-factories
  • jsonapi-atomic-operations
  • vueify-messages
  • tic-2341
  • 135-translatable-study-areas
  • extensible-sorm-action-parameters
  • sorm-configuration-trait
  • jsonapi-mvv-routes
  • docblocks-for-magic-methods
19 results

StandardFile.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    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];
        }
    }