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

DistributedTracing::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
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