UserAgent   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
cbo 0
dl 0
loc 42
rs 10
c 0
b 0
f 0
ccs 13
cts 13
cp 1

5 Methods

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