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

UserAgent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 40
ccs 0
cts 21
cp 0
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getBrowserVersion() 0 3 1
A getBrowseName() 0 3 1
A getPlatform() 0 3 1
A create() 0 3 1
A __construct() 0 5 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
    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