File tree Expand file tree Collapse file tree 6 files changed +49
-23
lines changed
Resources/DependencyInjection Expand file tree Collapse file tree 6 files changed +49
-23
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
- declare (strict_types=1 );
3
-
4
2
namespace Jaeger \Symfony \Bridge ;
5
3
6
4
use Jaeger \Symfony \Debug \Extractor \DebugExtractorInterface ;
@@ -37,13 +35,19 @@ public static function getSubscribedEvents()
37
35
];
38
36
}
39
37
38
+ /**
39
+ * @return DebugListener
40
+ */
40
41
public function onTerminate ()
41
42
{
42
43
$ this ->debuggable ->disable ();
43
44
44
45
return $ this ;
45
46
}
46
47
48
+ /**
49
+ * @return DebugListener
50
+ */
47
51
public function onStart ()
48
52
{
49
53
if ('' === ($ debugId = $ this ->extractor ->getDebug ())) {
Original file line number Diff line number Diff line change 1
1
<?php
2
- declare (strict_types=1 );
3
-
4
2
namespace Jaeger \Symfony \Debug \Extractor ;
5
3
6
4
use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
@@ -14,9 +12,14 @@ class CookieDebugExtractor implements DebugExtractorInterface, EventSubscriberIn
14
12
15
13
private $ cookieName ;
16
14
17
- public function __construct (string $ cookieName )
15
+ /**
16
+ * CookieDebugExtractor constructor.
17
+ *
18
+ * @param string $cookieName
19
+ */
20
+ public function __construct ($ cookieName )
18
21
{
19
- $ this ->cookieName = $ cookieName ;
22
+ $ this ->cookieName = ( string ) $ cookieName ;
20
23
}
21
24
22
25
public function onRequest (GetResponseEvent $ event )
@@ -42,9 +45,12 @@ public function onTerminate()
42
45
return $ this ;
43
46
}
44
47
45
- public function getDebug (): string
48
+ /**
49
+ * @return string
50
+ */
51
+ public function getDebug ()
46
52
{
47
- return $ this ->debugId ;
53
+ return ( string ) $ this ->debugId ;
48
54
}
49
55
50
56
public static function getSubscribedEvents ()
Original file line number Diff line number Diff line change 1
1
<?php
2
- declare (strict_types=1 );
3
-
4
2
namespace Jaeger \Symfony \Debug \Extractor ;
5
3
6
4
class DebugExtractorChain implements DebugExtractorInterface
7
5
{
8
6
private $ queue ;
9
7
8
+ /**
9
+ * DebugExtractorChain constructor.
10
+ *
11
+ * @param \SplPriorityQueue $queue
12
+ */
10
13
public function __construct (\SplPriorityQueue $ queue )
11
14
{
12
15
$ this ->queue = $ queue ;
13
16
}
14
17
15
- public function add (DebugExtractorInterface $ extractor , int $ priority = 0 ): DebugExtractorChain
18
+ /**
19
+ * @param DebugExtractorInterface $extractor
20
+ * @param int $priority
21
+ *
22
+ * @return DebugExtractorChain
23
+ */
24
+ public function add (DebugExtractorInterface $ extractor , $ priority = 0 )
16
25
{
17
- $ this ->queue ->insert ($ extractor , $ priority );
26
+ $ this ->queue ->insert ($ extractor , ( int ) $ priority );
18
27
19
28
return $ this ;
20
29
}
21
30
22
- public function getDebug (): string
31
+ /**
32
+ * @return string
33
+ */
34
+ public function getDebug ()
23
35
{
24
36
$ queue = clone $ this ->queue ;
25
37
while (false === $ queue ->isEmpty ()) {
Original file line number Diff line number Diff line change 1
1
<?php
2
- declare (strict_types=1 );
3
-
4
2
namespace Jaeger \Symfony \Debug \Extractor ;
5
3
6
4
interface DebugExtractorInterface
7
5
{
8
6
/**
9
7
* @return string
10
8
*/
11
- public function getDebug () : string ;
9
+ public function getDebug ();
12
10
}
Original file line number Diff line number Diff line change 1
1
<?php
2
- declare (strict_types=1 );
3
2
4
3
namespace Jaeger \Symfony \Debug \Extractor ;
5
4
@@ -12,7 +11,12 @@ class EnvDebugExtractor implements DebugExtractorInterface, EventSubscriberInter
12
11
13
12
private $ debugId = '' ;
14
13
15
- public function __construct (string $ envName )
14
+ /**
15
+ * EnvDebugExtractor constructor.
16
+ *
17
+ * @param string $envName
18
+ */
19
+ public function __construct ($ envName )
16
20
{
17
21
$ this ->envName = $ envName ;
18
22
}
@@ -32,14 +36,17 @@ public function onTerminate()
32
36
return $ this ;
33
37
}
34
38
35
- public function getDebug (): string
39
+ /**
40
+ * @return string
41
+ */
42
+ public function getDebug ()
36
43
{
37
- return $ this ->debugId ;
44
+ return ( string ) $ this ->debugId ;
38
45
}
39
46
40
47
public function onCommand ()
41
48
{
42
- if (null === ( $ data = $ _ENV [ $ this ->envName ] ?? null )) {
49
+ if (false === array_key_exists ( $ this ->envName , $ _ENV )) {
43
50
return $ this ;
44
51
}
45
52
$ this ->debugId = (string )$ _ENV [$ this ->envName ];
Original file line number Diff line number Diff line change 1
1
<?php
2
- declare (strict_types=1 );
3
2
4
3
namespace Jaeger \Symfony \Resources \DependencyInjection ;
5
4
@@ -20,7 +19,7 @@ public function process(ContainerBuilder $container)
20
19
$ definition = $ container ->getDefinition ('jaeger.debug.extractor.chain ' );
21
20
foreach ($ container ->findTaggedServiceIds ('jaeger.debug.extractor ' ) as $ id => $ tags ) {
22
21
foreach ($ tags as $ tag ) {
23
- $ priority = $ tag ['priority ' ] ?? 0 ;
22
+ $ priority = array_key_exists ( ' priority ' , $ tag) ? $ tag ['priority ' ] : 0 ;
24
23
$ definition ->addMethodCall ('add ' , [new Reference ($ id ), $ priority ]);
25
24
}
26
25
}
You can’t perform that action at this time.
0 commit comments