File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 5
5
6
6
use Jaeger \Http \HttpMethodTag ;
7
7
use Jaeger \Http \HttpUriTag ;
8
- use Jaeger \Span \Span ;
8
+ use Jaeger \Span \SpanInterface ;
9
9
use Jaeger \Symfony \Tag \SymfonyBackgroundTag ;
10
10
use Jaeger \Symfony \Tag \SymfonyComponentTag ;
11
11
use Jaeger \Symfony \Tag \SymfonyVersionTag ;
15
15
16
16
class BackgroundSpanHandler
17
17
{
18
- /**
19
- * @var Span
20
- */
21
- private $ span ;
18
+ private ?SpanInterface $ span ;
22
19
23
- private $ tracer ;
20
+ private TracerInterface $ tracer ;
24
21
25
22
public function __construct (TracerInterface $ tracer )
26
23
{
@@ -50,6 +47,7 @@ public function flush(): BackgroundSpanHandler
50
47
return $ this ;
51
48
}
52
49
$ this ->span ->finish ();
50
+ $ this ->span = null ;
53
51
54
52
return $ this ;
55
53
}
Original file line number Diff line number Diff line change 9
9
10
10
class GlobalSpanListener implements EventSubscriberInterface
11
11
{
12
- private $ handler ;
12
+ private GlobalSpanHandler $ handler ;
13
13
14
14
public function __construct (GlobalSpanHandler $ handler )
15
15
{
16
16
$ this ->handler = $ handler ;
17
17
}
18
18
19
- public static function getSubscribedEvents ()
19
+ public static function getSubscribedEvents (): array
20
20
{
21
21
return [
22
22
RequestEvent::class => ['onRequest ' , 30 ],
23
23
TerminateEvent::class => ['onTerminate ' , 4096 ],
24
24
];
25
25
}
26
26
27
- public function onTerminate ()
27
+ public function onTerminate (): GlobalSpanListener
28
28
{
29
29
$ this ->handler ->finish ();
30
30
31
31
return $ this ;
32
32
}
33
33
34
- public function onRequest (RequestEvent $ event )
34
+ public function onRequest (RequestEvent $ event ): GlobalSpanListener
35
35
{
36
36
if (false === $ event ->isMasterRequest ()) {
37
37
return $ this ;
You can’t perform that action at this time.
0 commit comments