Completed
Push — master ( 5c75e0...2a6bdb )
by Pascal
02:56
created

DistributedTracing   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 23
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toArray() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PascalDeVink\CloudEvents\Extension;
6
7
class DistributedTracing implements Extension
8
{
9
    /**
10
     * @var string
11
     */
12
    private $traceparent;
13
14
    /**
15
     * @var null|string
16
     */
17
    private $tracestate;
18
19
    public function __construct(string $traceparent, ?string $tracestate = null)
20
    {
21
        $this->traceparent = $traceparent;
22
        $this->tracestate = $tracestate;
23
    }
24
25
    public function toArray() : array
26
    {
27
        return [
28
            'traceparent' => $this->traceparent,
29
            'tracestate' => $this->tracestate,
30
        ];
31
    }
32
}
33