System   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 5
c 2
b 1
f 0
dl 0
loc 40
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isSolaris() 0 3 1
A isLinux() 0 3 1
A isOSX() 0 3 2
A isWindows() 0 3 1
1
<?php
2
3
/**
4
 * Ping for Laravel.
5
 *
6
 * This class makes Ping request to a host.
7
 *
8
 * Ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway.
9
 *
10
 * @author  Angel Campos <[email protected]>
11
 *
12
 * @requires PHP 8.0
13
 *
14
 * @version  2.1.2
15
 */
16
17
namespace Acamposm\Ping;
18
19
class System
20
{
21
    /**
22
     * Return TRUE if OS is Linux.
23
     *
24
     * @return bool
25
     */
26
    public static function isLinux(): bool
27
    {
28
        return PHP_OS_FAMILY === 'Linux';
29
    }
30
31
    /**
32
     * Return TRUE if OS is Apple OSX.
33
     *
34
     * @return bool
35
     */
36
    public static function isOSX(): bool
37
    {
38
        return PHP_OS_FAMILY === 'OSX' || PHP_OS_FAMILY === 'Darwin';
39
    }
40
41
    /**
42
     * Return TRUE if OS is Solaris.
43
     *
44
     * @return bool
45
     */
46
    public static function isSolaris(): bool
47
    {
48
        return PHP_OS_FAMILY === 'Solaris';
49
    }
50
51
    /**
52
     * Return TRUE if OS is Windows.
53
     *
54
     * @return bool
55
     */
56
    public static function isWindows(): bool
57
    {
58
        return PHP_OS_FAMILY === 'Windows';
59
    }
60
}
61