private function convertSpans(array $spans)
    {
        return array_map(function (SpanData $span) {
            return [
                'traceId' => $span->traceId(),
                'name' => $span->name(),
                'spanId' => $span->spanId(),
                'parentSpanId' => $span->parentSpanId(),
                'stackTrace' => $span->stackTrace(),
                'startTime' => $span->startTime(),
                'endTime' => $span->endTime(),
                'status' => $span->status(),
                'attributes' => $span->attributes(),
                'timeEvents' => $span->timeEvents(),
                'links' => $span->links(),
                'sameProcessAsParentSpan' => $span->sameProcessAsParentSpan(),
            ];
        }, $spans);
    }
private function convertSpans(array $spans)
    {
        return array_map(function (SpanData $span) {
            return [
                'traceId' => $span->traceId(),
                'name' => $span->name(),
                'spanId' => $span->spanId(),
                'parentSpanId' => $span->parentSpanId(),
                'stackTrace' => $span->stackTrace(),
                'startTime' => $span->startTime(),
                'endTime' => $span->endTime(),
                'status' => $span->status(),
                'attributes' => $span->attributes(),
                'timeEvents' => $span->timeEvents(),
                'links' => $span->links(),
                'sameProcessAsParentSpan' => $span->sameProcessAsParentSpan(),
            ];
        }, $spans);
    }
private function convertSpans ( array $ spans ) { return array_map ( function ( SpanData $ span ) { return [ 'traceId' => $ span -> traceId ( ) , 'name' => $ span -> name ( ) , 'spanId' => $ span -> spanId ( ) , 'parentSpanId' => $ span -> parentSpanId ( ) , 'stackTrace' => $ span -> stackTrace ( ) , 'startTime' => $ span -> startTime ( ) , 'endTime' => $ span -> endTime ( ) , 'status' => $ span -> status ( ) , 'attributes' => $ span -> attributes ( ) , 'timeEvents' => $ span -> timeEvents ( ) , 'links' => $ span -> links ( ) , 'sameProcessAsParentSpan' => $ span -> sameProcessAsParentSpan ( ) , ] ; } , $ spans ) ; }
Convert spans into array ready for serialization.

@param SpanData[] $spans
@return array Representation of the collected trace spans ready for serialization
Convert spans into array ready for serialization .