System   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 59
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isMac() 0 4 1
A isWindows() 0 4 1
A isLinux() 0 7 2
A is64Bit() 0 4 1
1
<?php
2
namespace Peridot\WebDriverManager\OS;
3
4
/**
5
 * System determines information about the operating system.
6
 *
7
 * @package Peridot\WebDriverManager\OS
8
 */
9
class System implements SystemInterface
10
{
11
    /**
12
     * Darwin pattern
13
     *
14
     * @var string
15
     */
16
    private static $darwin = '/^dar/i';
17
18
    /**
19
     * Windows
20
     *
21
     * @var string
22
     */
23
    private static $windows = '/^win/i';
24
25
    /**
26
     * {@inheritdoc}
27
     *
28
     * @return bool
29
     */
30
    public function isMac()
31
    {
32
        return preg_match(self::$darwin, PHP_OS);
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     *
38
     * @return bool
39
     */
40
    public function isWindows()
41
    {
42
        return preg_match(self::$windows, PHP_OS);
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     *
48
     * @return bool
49
     */
50
    public function isLinux()
51
    {
52
        $notMac = ! $this->isMac();
53
        $notWindows = ! $this->isWindows();
54
55
        return $notMac && $notWindows;
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     *
61
     * @return bool
62
     */
63
    public function is64Bit()
64
    {
65
        return PHP_INT_SIZE === 8;
66
    }
67
} 
68