for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SwooleTW\Http\Helpers;
use Illuminate\Support\Str;
/**
* Class OS
*/
final class OS
{
* Mac OS
*
* @const string
public const MAC_OS = 'dar';
* Linux
public const LINUX = 'lin';
public const WIN = 'win';
* Cygwin
public const CYGWIN = 'cyg';
* Returns true if current OS in types
* @param string ...$types
* @return bool
public static function is(string ...$types): bool
return Str::contains(static::current(), $types);
}
* Current OS
* @return string
public static function current(): string
return Str::substr(Str::lower(PHP_OS), 0, 3);