Skip to content

Commit aafc787

Browse files
committed
Code style fixes and php language requirements update
1 parent fb79a4b commit aafc787

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/Bridge/BackgroundSpanHandler.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use Jaeger\Http\HttpMethodTag;
77
use Jaeger\Http\HttpUriTag;
8-
use Jaeger\Span\Span;
8+
use Jaeger\Span\SpanInterface;
99
use Jaeger\Symfony\Tag\SymfonyBackgroundTag;
1010
use Jaeger\Symfony\Tag\SymfonyComponentTag;
1111
use Jaeger\Symfony\Tag\SymfonyVersionTag;
@@ -15,12 +15,9 @@
1515

1616
class BackgroundSpanHandler
1717
{
18-
/**
19-
* @var Span
20-
*/
21-
private $span;
18+
private ?SpanInterface $span;
2219

23-
private $tracer;
20+
private TracerInterface $tracer;
2421

2522
public function __construct(TracerInterface $tracer)
2623
{
@@ -50,6 +47,7 @@ public function flush(): BackgroundSpanHandler
5047
return $this;
5148
}
5249
$this->span->finish();
50+
$this->span = null;
5351

5452
return $this;
5553
}

src/Bridge/GlobalSpanListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@
99

1010
class GlobalSpanListener implements EventSubscriberInterface
1111
{
12-
private $handler;
12+
private GlobalSpanHandler $handler;
1313

1414
public function __construct(GlobalSpanHandler $handler)
1515
{
1616
$this->handler = $handler;
1717
}
1818

19-
public static function getSubscribedEvents()
19+
public static function getSubscribedEvents(): array
2020
{
2121
return [
2222
RequestEvent::class => ['onRequest', 30],
2323
TerminateEvent::class => ['onTerminate', 4096],
2424
];
2525
}
2626

27-
public function onTerminate()
27+
public function onTerminate(): GlobalSpanListener
2828
{
2929
$this->handler->finish();
3030

3131
return $this;
3232
}
3333

34-
public function onRequest(RequestEvent $event)
34+
public function onRequest(RequestEvent $event): GlobalSpanListener
3535
{
3636
if (false === $event->isMasterRequest()) {
3737
return $this;

0 commit comments

Comments
 (0)