getServerParams()['SERVER_SOFTWARE'] ?? '')); } public static function fromType(string $type): self { if ($type === 'apache' || str_starts_with($type, 'Apache')) { return self::Apache; } if ($type === 'iis' || str_starts_with($type, 'Microsoft-IIS')) { return self::MicrosoftInternetInformationServer; } return self::Other; } /** * @return array */ public static function getDescriptions(): array { return [ self::Apache->value => 'Apache', self::MicrosoftInternetInformationServer->value => 'Microsoft IIS', self::Other->value => 'Other (use for anything else)', ]; } public function isApacheServer(): bool { return $this === self::Apache; } public function isMicrosoftInternetInformationServer(): bool { return $this === self::MicrosoftInternetInformationServer; } }