Passed
Push — master ( e8f12c...c4db50 )
by Michał
03:14
created

UserAgent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dziki\MonologSentryBundle\UserAgent;
6
7
class UserAgent
8
{
9
    /**
10
     * @var string
11
     */
12
    private $browseName;
13
    /**
14
     * @var string
15
     */
16
    private $browserVersion;
17
    /**
18
     * @var string
19
     */
20
    private $platform;
21
22
    private function __construct(string $browseName, string $browserVersion, string $platform)
23
    {
24
        $this->browseName = $browseName;
25
        $this->browserVersion = $browserVersion;
26
        $this->platform = $platform;
27
    }
28
29
    public static function create(string $browseName, string $browserVersion, string $platform): self
30
    {
31
        return new self($browseName, $browserVersion, $platform);
32
    }
33
34
    public function getBrowseName(): string
35
    {
36
        return $this->browseName;
37
    }
38
39
    public function getBrowserVersion(): string
40
    {
41
        return $this->browserVersion;
42
    }
43
44
    public function getPlatform(): string
45
    {
46
        return $this->platform;
47
    }
48
}
49