Skip to content

Commit 629179d

Browse files
committed
Code style fixes
1 parent c1f85d8 commit 629179d

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

src/Bridge/ContextInjector.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public static function getSubscribedEvents()
3131
];
3232
}
3333

34+
public function onCommand()
35+
{
36+
return $this->inject();
37+
}
38+
3439
public function inject(): ContextInjector
3540
{
3641
if (null === ($context = $this->extractor->extract())) {
@@ -41,11 +46,6 @@ public function inject(): ContextInjector
4146
return $this;
4247
}
4348

44-
public function onCommand()
45-
{
46-
return $this->inject();
47-
}
48-
4949
public function onRequest()
5050
{
5151
return $this->inject();

src/Bridge/RequestSpanListener.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@ public static function getSubscribedEvents()
4141
];
4242
}
4343

44-
public function getOperationName(Request $request)
45-
{
46-
if (null !== ($fragment = $request->attributes->get('is_fragment'))) {
47-
return ($controller = $request->attributes->get('_controller', null))
48-
? sprintf('fragment.%s', $controller)
49-
: 'fragment';
50-
}
51-
52-
if (null === ($routeName = $request->attributes->get('_route', null))) {
53-
return $request->getRequestUri();
54-
}
55-
56-
return $routeName;
57-
}
58-
5944
public function onResponse(FilterResponseEvent $event)
6045
{
6146
if ($this->spans->isEmpty()) {
@@ -102,4 +87,19 @@ public function onRequest(GetResponseEvent $event)
10287

10388
return $this;
10489
}
90+
91+
public function getOperationName(Request $request)
92+
{
93+
if (null !== ($fragment = $request->attributes->get('is_fragment'))) {
94+
return ($controller = $request->attributes->get('_controller', null))
95+
? sprintf('fragment.%s', $controller)
96+
: 'fragment';
97+
}
98+
99+
if (null === ($routeName = $request->attributes->get('_route', null))) {
100+
return $request->getRequestUri();
101+
}
102+
103+
return $routeName;
104+
}
105105
}

src/Context/Extractor/ContextExtractorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
interface ContextExtractorInterface
99
{
10-
public function extract() : ?SpanContext;
10+
public function extract(): ?SpanContext;
1111
}

src/Context/Extractor/EnvContextExtractor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ public function __construct(CodecRegistry $registry, string $format, string $env
2929
$this->envName = $envName;
3030
}
3131

32-
public function extract(): ?SpanContext
33-
{
34-
return $this->context;
35-
}
36-
3732
public static function getSubscribedEvents()
3833
{
3934
return [
4035
ConsoleEvents::COMMAND => ['onCommand', 2048],
4136
];
4237
}
4338

39+
public function extract(): ?SpanContext
40+
{
41+
return $this->context;
42+
}
43+
4444
public function onCommand()
4545
{
4646
if (null === ($data = $_ENV[$this->envName] ?? null)) {

src/Context/Extractor/HeaderContextExtractor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ public function __construct(CodecRegistry $registry, string $format, string $hea
3131
$this->headerName = $headerName;
3232
}
3333

34-
public function extract(): ?SpanContext
35-
{
36-
return $this->context;
37-
}
38-
3934
public static function getSubscribedEvents()
4035
{
4136
return [
4237
KernelEvents::REQUEST => ['onRequest', 2048],
4338
];
4439
}
4540

41+
public function extract(): ?SpanContext
42+
{
43+
return $this->context;
44+
}
45+
4646
public function onRequest(GetResponseEvent $event)
4747
{
4848
$request = $event->getRequest();

0 commit comments

Comments
 (0)