File tree Expand file tree Collapse file tree 1 file changed +26
-7
lines changed Expand file tree Collapse file tree 1 file changed +26
-7
lines changed Original file line number Diff line number Diff line change 8
8
9
9
class RequestContextProvider implements ContextProviderInterface
10
10
{
11
- /** @var Request */
11
+ /**
12
+ * The current request.
13
+ *
14
+ * @var \Illuminate\Http\Request|null
15
+ */
12
16
private $ currentRequest ;
13
17
14
- /** @var VarCloner */
18
+ /**
19
+ * The variable cloner.
20
+ *
21
+ * @var \Symfony\Component\VarDumper\Cloner\VarCloner
22
+ */
15
23
private $ cloner ;
16
24
25
+ /**
26
+ * RequestContextProvider constructor.
27
+ *
28
+ * @param \Illuminate\Http\Request|null $currentRequest
29
+ * @return void
30
+ */
17
31
public function __construct (Request $ currentRequest = null )
18
32
{
19
33
$ this ->currentRequest = $ currentRequest ;
20
- $ this ->cloner = new VarCloner () ;
34
+ $ this ->cloner = new VarCloner ;
21
35
$ this ->cloner ->setMaxItems (0 );
22
36
}
23
37
38
+ /**
39
+ * Get the context.
40
+ *
41
+ * @return array|null
42
+ */
24
43
public function getContext (): ?array
25
44
{
26
- if (null === $ this ->currentRequest ) {
27
- return null ;
45
+ if ($ this ->currentRequest === null ) {
46
+ return ;
28
47
}
29
48
30
49
$ controller = null ;
@@ -37,11 +56,11 @@ public function getContext(): ?array
37
56
}
38
57
}
39
58
40
- return array (
59
+ return [
41
60
'uri ' => $ this ->currentRequest ->getUri (),
42
61
'method ' => $ this ->currentRequest ->getMethod (),
43
62
'controller ' => $ controller ? $ this ->cloner ->cloneVar (class_basename ($ controller )) : $ controller ,
44
63
'identifier ' => spl_object_hash ($ this ->currentRequest ),
45
- ) ;
64
+ ] ;
46
65
}
47
66
}
You can’t perform that action at this time.
0 commit comments