40 lines
502 B
PHP
40 lines
502 B
PHP
<?php
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
namespace Kiri;
|
|
|
|
|
|
use JetBrains\PhpStorm\Pure;
|
|
|
|
/**
|
|
* Class Environmental
|
|
* @package Kiri
|
|
*/
|
|
class Environmental
|
|
{
|
|
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isMac(): bool
|
|
{
|
|
$os = strtolower(PHP_OS);
|
|
|
|
return str_contains($os, 'mac') || str_contains($os, 'darwin');
|
|
}
|
|
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
#[Pure] public function isLinux(): bool
|
|
{
|
|
return PHP_OS_FAMILY === 'Linux' || strtolower(PHP_OS) === 'linux';
|
|
}
|
|
|
|
}
|