Passed
Pull Request — master (#6)
by Vitaliy
11:46
created
src/Middleware/JobTracingMiddleware.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,23 +30,23 @@
 block discarded – undo
30 30
 
31 31
     public function handle($job, callable $next)
32 32
     {
33
-        $payload = $job->{self::JOB_TRACING_CONTEXT_FIELD} ?? [];
33
+        $payload = $job->{self::JOB_TRACING_CONTEXT_FIELD} ?? [ ];
34 34
 
35 35
         $traceIdHeader = $this->traceIdHeaderRetriever->retrieve($payload);
36 36
 
37 37
         $span = $this->spanCreator->create(
38
-            Caller::call(Config::get('jaravel.job.span_name'), [$job, $job->job ?? null]),
38
+            Caller::call(Config::get('jaravel.job.span_name'), [ $job, $job->job ?? null ]),
39 39
             $traceIdHeader,
40 40
             Reference::FOLLOWS_FROM
41 41
         );
42 42
 
43 43
         $next($job);
44 44
 
45
-        $callableConfig = Config::get('jaravel.job.tags', fn () => [
45
+        $callableConfig = Config::get('jaravel.job.tags', fn() => [
46 46
             'type' => 'job',
47 47
         ]);
48 48
 
49
-        SpanTagHelper::setTags($span, Caller::call($callableConfig, [$job, $job->job ?? null]));
49
+        SpanTagHelper::setTags($span, Caller::call($callableConfig, [ $job, $job->job ?? null ]));
50 50
 
51 51
         optional($this->tracer->getScopeManager()->getActive())
52 52
             ->close();
Please login to merge, or discard this patch.
src/Services/TraceIdHeaderRetriever.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@
 block discarded – undo
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
-        if (empty($carrier[TRACE_ID_HEADER])) {
11
+        if (empty($carrier[ TRACE_ID_HEADER ])) {
12 12
             return null;
13 13
         }
14 14
 
15
-        if (is_array($carrier[TRACE_ID_HEADER])) {
16
-            return $carrier[TRACE_ID_HEADER][0];
15
+        if (is_array($carrier[ TRACE_ID_HEADER ])) {
16
+            return $carrier[ TRACE_ID_HEADER ][ 0 ];
17 17
         }
18 18
 
19
-        return $carrier[TRACE_ID_HEADER];
19
+        return $carrier[ TRACE_ID_HEADER ];
20 20
     }
21 21
 }
Please login to merge, or discard this patch.
src/Services/Span/SpanCreator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@
 block discarded – undo
38 38
         }
39 39
 
40 40
         $spanContext = $this->tracer
41
-            ->extract(Formats\TEXT_MAP, [TRACE_ID_HEADER => $traceIdHeader]);
41
+            ->extract(Formats\TEXT_MAP, [ TRACE_ID_HEADER => $traceIdHeader ]);
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
 }
Please login to merge, or discard this patch.
src/config/jaravel.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     'http' => [
42 42
         'span_name' => Configurations\Http\SpanNameResolver::class,
43
-        'tags' => fn (Request $request, Response $response) => [
43
+        'tags' => fn(Request $request, Response $response) => [
44 44
             'type' => 'http',
45 45
             'request_host' => $request->getHost(),
46 46
             'request_path' => $request->path(),
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
      * Describes configuration for console commands
55 55
      */
56 56
     'console' => [
57
-        'span_name' => fn (string $command, ?InputInterface $input = null) => 'Console: ' . $command,
58
-        'filter_commands' => ['schedule:run', 'horizon', 'queue:'],
59
-        'tags' => fn (string $command, int $exitCode, ?InputInterface $input = null, ?OutputInterface $output = null) => [
57
+        'span_name' => fn(string $command, ?InputInterface $input = null) => 'Console: ' . $command,
58
+        'filter_commands' => [ 'schedule:run', 'horizon', 'queue:' ],
59
+        'tags' => fn(string $command, int $exitCode, ?InputInterface $input = null, ?OutputInterface $output = null) => [
60 60
             'type' => 'console',
61 61
             'console_command' => $command,
62 62
             'console_exit_code' => $exitCode,
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
      * Describes configuration for queued jobs
68 68
      */
69 69
     'job' => [
70
-        'span_name' => fn ($realJob, ?Job $job) => 'Job: ' . get_class($realJob),
71
-        'tags' => fn ($realJob, ?Job $job) => [
70
+        'span_name' => fn($realJob, ?Job $job) => 'Job: ' . get_class($realJob),
71
+        'tags' => fn($realJob, ?Job $job) => [
72 72
             'type' => 'job',
73 73
             'job_class' => get_class($realJob),
74 74
             'job_id' => optional($job)
Please login to merge, or discard this patch.