NativeParser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dziki\MonologSentryBundle\UserAgent;
6
7
class NativeParser implements ParserInterface
8
{
9
    public function parse(string $userAgent): UserAgent
10
    {
11
        [
12
            'browser' => $browserName,
13
            'version' => $browserVersion,
14
            'platform' => $platform,
15
        ]
16
            = \get_browser($userAgent, true);
17
18
        return UserAgent::create($browserName, $browserVersion, $platform);
19
    }
20
}
21