Refactor getOs()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
48cd962475
commit
0d5dd21bf6
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user