Passed
Pull Request — master (#1206)
by Aleksei
12:42
created
src/Telemetry/src/AbstractTracer.php 1 patch
Braces   +17 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,33 +28,43 @@
 block discarded – undo
28 28
     final protected function runScope(SpanInterface $span, callable $callback): mixed
29 29
     {
30 30
         $container = ContainerScope::getContainer();
31
-        if ($container === null) {
31
+        if ($container === null)
32
+        {
32 33
             return $this->scope->runScope([
33 34
                 SpanInterface::class => $span,
34 35
                 TracerInterface::class => $this,
35 36
             ], static fn (InvokerInterface $invoker): mixed => $invoker->invoke($callback));
36 37
         }
37 38
 
38
-        if ($container instanceof Container) {
39
+        if ($container instanceof Container)
40
+        {
39 41
             $invoker = $container;
40 42
             $binder = $container;
41
-        } else {
43
+        }
44
+        else
45
+        {
42 46
             /** @var InvokerInterface $invoker */
43 47
             $invoker = $container->get(InvokerInterface::class);
44 48
             /** @var BinderInterface $binder */
45 49
             $binder = $container->get(BinderInterface::class);
46 50
         }
47 51
 
48
-        try {
52
+        try
53
+        {
49 54
             $prevSpan = $container->get(SpanInterface::class);
50
-        } catch (\Throwable) {
55
+        }
56
+        catch (\Throwable)
57
+        {
51 58
             $prevSpan = null;
52 59
         }
53 60
 
54 61
         $binder->bindSingleton(SpanInterface::class, $span);
55
-        try {
62
+        try
63
+        {
56 64
             return $invoker->invoke($callback);
57
-        } finally {
65
+        }
66
+        finally
67
+        {
58 68
             $prevSpan === null
59 69
                 ? $binder->removeBinding(SpanInterface::class)
60 70
                 : $binder->bindSingleton(SpanInterface::class, $prevSpan);
Please login to merge, or discard this patch.