Test Failed
Push — master ( 86fa5f...d794d1 )
by Dmitry
02:18
created

BasisExporter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 11
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A convertSpan() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace OpenTelemetry\Exporter;
6
7
use OpenTelemetry\Exporter;
8
use OpenTelemetry\Tracing\Span;
9
use OpenTelemetry\Tracing\Tracer;
10
11
class BasisExporter extends Exporter
12
{
13
    public function convertSpan(Span $span) : array
14
    {
15
        return [
16
            'traceId' => $span->getSpanContext()->getTraceId(),
17
            'spanId' => $span->getSpanContext()->getSpanId(),
18
            'parentSpanId' => $span->getParentSpanContext() 
19
                ? $span->getParentSpanContext()->getSpanId()
20
                : null,
21
            'body' => serialize($span),
22
        ];
23
    }
24
}
25