File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,11 @@ public static function getSubscribedEvents(): array
36
36
37
37
public function onCommand (ConsoleCommandEvent $ event ): void
38
38
{
39
- if (null === $ event ->getCommand ()) {
39
+ if (null === $ command = $ event ->getCommand ()) {
40
40
return ;
41
41
}
42
- $ this ->name = (string )$ event ->getCommand ()->getName ();
42
+
43
+ $ this ->name = (string )$ command ->getName ();
43
44
}
44
45
45
46
public function onTerminate (): CommandNameGenerator
Original file line number Diff line number Diff line change @@ -26,22 +26,24 @@ public static function getSubscribedEvents(): array
26
26
27
27
public function onCommand (ConsoleCommandEvent $ event ): void
28
28
{
29
- if (null === $ event ->getCommand ()) {
29
+ if (null === $ command = $ event ->getCommand ()) {
30
30
return ;
31
31
}
32
32
33
- $ this ->name = (string )$ event -> getCommand () ->getName ();
33
+ $ this ->name = (string )$ command ->getName ();
34
34
}
35
35
36
36
public function onRequest (RequestEvent $ event ): void
37
37
{
38
38
$ request = $ event ->getRequest ();
39
- if (null !== ( $ fragment = $ request ->attributes ->get ('is_fragment ' ) )) {
40
- $ this ->name = ($ controller = $ request ->attributes ->get ('_controller ' , null ))
39
+ if (null !== $ request ->attributes ->get ('is_fragment ' )) {
40
+ $ this ->name = (null !== $ controller = $ request ->attributes ->get ('_controller ' , null ))
41
41
? sprintf ('fragment.%s ' , $ controller )
42
42
: 'fragment ' ;
43
+
43
44
return ;
44
45
}
46
+
45
47
$ this ->name = $ request ->attributes ->get ('_route ' , $ request ->getRequestUri ());
46
48
}
47
49
You can’t perform that action at this time.
0 commit comments