UserAgent::getBrowseName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 0
crap 1
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 5
    private function __construct(string $browseName, string $browserVersion, string $platform)
23
    {
24 5
        $this->browseName = $browseName;
25 5
        $this->browserVersion = $browserVersion;
26 5
        $this->platform = $platform;
27 5
    }
28
29 5
    public static function create(string $browseName, string $browserVersion, string $platform): self
30
    {
31 5
        return new self($browseName, $browserVersion, $platform);
32
    }
33
34 3
    public function getBrowseName(): string
35
    {
36 3
        return $this->browseName;
37
    }
38
39 3
    public function getBrowserVersion(): string
40
    {
41 3
        return $this->browserVersion;
42
    }
43
44 3
    public function getPlatform(): string
45
    {
46 3
        return $this->platform;
47
    }
48
}
49