Browser   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
c 1
b 0
f 0
dl 0
loc 36
ccs 8
cts 8
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A disableAutomaticTimingScripts() 0 3 1
A getHeaderScript() 0 3 1
A getFooterScript() 0 3 1
1
<?php
2
declare(strict_types=1);
3
namespace ZERO2TEN\Observability\APM;
4
5
/**
6
 * Browser
7
 *
8
 * @copyright Copyright (c) 2023 0TO10 B.V. <https://0to10.nl>
9
 * @package ZERO2TEN\Observability\APM
10
 */
11
class Browser implements BrowserInterface
12
{
13
    /** @var AgentInterface */
14
    private $agent;
15
16
    /**
17
     * @param AgentInterface $agent
18
     * @constructor
19
     */
20 1
    public function __construct(AgentInterface $agent)
21
    {
22 1
        $this->agent = $agent;
23
    }
24
25
    /**
26
     * @inheritDoc
27
     */
28 1
    public function disableAutomaticTimingScripts(): void
29
    {
30 1
        $this->agent->disableAutomaticBrowserMonitoringScripts();
31
    }
32
33
    /**
34
     * @inheritDoc
35
     */
36 1
    public function getHeaderScript(): string
37
    {
38 1
        return $this->agent->getBrowserMonitoringHeaderScript();
39
    }
40
41
    /**
42
     * @inheritDoc
43
     */
44 1
    public function getFooterScript(): string
45
    {
46 1
        return $this->agent->getBrowserMonitoringFooterScript();
47
    }
48
}
49