Refactor getOs()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2023-12-05 23:18:42 +01:00
parent 48cd962475
commit 0d5dd21bf6
2 changed files with 2 additions and 8 deletions

View File

@ -17355,11 +17355,6 @@ parameters:
count: 1
path: src/Server/SysInfo/SunOs.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Server/SysInfo/SysInfo.php
-
message: "#^Class COM referenced with incorrect case\\: com\\.$#"
count: 1

View File

@ -28,9 +28,8 @@ class SysInfo
public static function getOs(string $phpOs = PHP_OS): string
{
// look for common UNIX-like systems
$unixLike = ['FreeBSD', 'DragonFly'];
if (in_array($phpOs, $unixLike)) {
$phpOs = 'Linux';
if (in_array($phpOs, ['FreeBSD', 'DragonFly'], true)) {
return 'Linux';
}
return ucfirst($phpOs);