System::is64Bit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
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