Client::agent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 1
c 2
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
namespace ZERO2TEN\Observability;
4
5
use ZERO2TEN\Observability\APM\AgentInterface;
6
use ZERO2TEN\Observability\APM\Browser;
7
use ZERO2TEN\Observability\APM\BrowserInterface;
8
use ZERO2TEN\Observability\APM\Transaction;
9
use ZERO2TEN\Observability\APM\TransactionInterface;
10
11
/**
12
 * Client
13
 *
14
 * @copyright Copyright (c) 2023 0TO10 B.V. <https://0to10.nl>
15
 * @package ZERO2TEN\Observability
16
 */
17
class Client
18
{
19
    /** @var AgentInterface */
20
    private $agent;
21
22
    /**
23
     * @param AgentInterface $agent
24
     * @constructor
25
     */
26 1
    public function __construct(AgentInterface $agent)
27
    {
28 1
        $this->agent = $agent;
29
    }
30
31
    /**
32
     * @return AgentInterface
33
     */
34 1
    public function agent(): AgentInterface
35
    {
36 1
        return $this->agent;
37
    }
38
39
    /**
40
     * @return BrowserInterface
41
     */
42 1
    public function browser(): BrowserInterface
43
    {
44 1
        return new Browser($this->agent);
45
    }
46
47
    /**
48
     * @return TransactionInterface
49
     */
50 1
    public function transaction(): TransactionInterface
51
    {
52 1
        return new Transaction($this->agent);
53
    }
54
}
55