@@ -27,6 +27,6 @@ |
||
| 27 | 27 | return null; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - return (string)$activeSpan->getContext()->getTraceId(); |
|
| 30 | + return (string) $activeSpan->getContext()->getTraceId(); |
|
| 31 | 31 | } |
| 32 | 32 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $this->tracer = $tracer; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - public function create(string $operationName, array $carrier = [], ?string $referenceType = null): Span |
|
| 21 | + public function create(string $operationName, array $carrier = [ ], ?string $referenceType = null): Span |
|
| 22 | 22 | { |
| 23 | 23 | return $this->tracer->startActiveSpan( |
| 24 | 24 | $operationName, |
@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | return $baseOptions; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $traceHeaderId = ($carrier['x-trace-id'] ?? null) ? $carrier['x-trace-id'][0] : ''; |
|
| 39 | + $traceHeaderId = ($carrier[ 'x-trace-id' ] ?? null) ? $carrier[ 'x-trace-id' ][ 0 ] : ''; |
|
| 40 | 40 | |
| 41 | - $spanContext = $this->tracer->extract(Formats\TEXT_MAP, ['X-Trace-Id' => $traceHeaderId]); |
|
| 41 | + $spanContext = $this->tracer->extract(Formats\TEXT_MAP, [ 'X-Trace-Id' => $traceHeaderId ]); |
|
| 42 | 42 | |
| 43 | 43 | return array_merge( |
| 44 | 44 | $baseOptions, |
| 45 | 45 | $spanContext ? [ |
| 46 | 46 | 'references' => new Reference($referenceType, $spanContext), |
| 47 | - ] : [] |
|
| 47 | + ] : [ ] |
|
| 48 | 48 | ); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -6,18 +6,18 @@ |
||
| 6 | 6 | |
| 7 | 7 | class TraceIdHeaderRetriever |
| 8 | 8 | { |
| 9 | - public function retrieve(array $carrier = []): ?string |
|
| 9 | + public function retrieve(array $carrier = [ ]): ?string |
|
| 10 | 10 | { |
| 11 | 11 | $headerName = strtolower(Config::get('jaravel.trace_id_header', 'x-trace-id')); |
| 12 | 12 | |
| 13 | - if (empty($carrier[$headerName])) { |
|
| 13 | + if (empty($carrier[ $headerName ])) { |
|
| 14 | 14 | return null; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - if (is_array($carrier[$headerName])) { |
|
| 18 | - return $carrier[$headerName][0]; |
|
| 17 | + if (is_array($carrier[ $headerName ])) { |
|
| 18 | + return $carrier[ $headerName ][ 0 ]; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | - return $carrier[$headerName]; |
|
| 21 | + return $carrier[ $headerName ]; |
|
| 22 | 22 | } |
| 23 | 23 | } |