Skip to content

Commit 3aa385e

Browse files
author
Pete Bishop
committed
Add Environment Class with OS Helpers
1 parent 5992b01 commit 3aa385e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/Support/Environment.php

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Native\Laravel\Support;
4+
5+
class Environment
6+
{
7+
public static function isWindows(): bool
8+
{
9+
return PHP_OS_FAMILY === 'Windows';
10+
}
11+
12+
public static function isLinux(): bool
13+
{
14+
return PHP_OS_FAMILY === 'Linux';
15+
}
16+
17+
public static function isMac(): bool
18+
{
19+
return PHP_OS_FAMILY === 'Darwin';
20+
}
21+
22+
public static function isUnknown(): bool
23+
{
24+
return PHP_OS_FAMILY === 'Unknown';
25+
}
26+
27+
public static function isUnixLike(): bool
28+
{
29+
return static::isLinux() || static::isMac();
30+
}
31+
}

0 commit comments

Comments
 (0)