File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 17
17
use Symfony \Component \Console \Output \OutputInterface ;
18
18
use Symfony \Component \Console \Output \Output ;
19
19
use Symfony \Component \Routing \Matcher \Dumper \ApacheMatcherDumper ;
20
+ use Symfony \Component \Routing \RouterInterface ;
20
21
21
22
/**
22
23
* RouterApacheDumperCommand.
25
26
*/
26
27
class RouterApacheDumperCommand extends ContainerAwareCommand
27
28
{
29
+ /**
30
+ * {@inheritDoc}
31
+ */
32
+ public function isEnabled ()
33
+ {
34
+ if (!$ this ->getContainer ()->has ('router ' )) {
35
+ return false ;
36
+ }
37
+ $ router = $ this ->getContainer ()->get ('router ' );
38
+ if (!$ router instanceof RouterInterface) {
39
+ return false ;
40
+ }
41
+ return parent ::isEnabled ();
42
+ }
43
+
28
44
/**
29
45
* @see Command
30
46
*/
Original file line number Diff line number Diff line change 17
17
use Symfony \Component \Console \Output \OutputInterface ;
18
18
use Symfony \Component \Console \Output \Output ;
19
19
use Symfony \Component \Routing \Matcher \Dumper \ApacheMatcherDumper ;
20
+ use Symfony \Component \Routing \RouterInterface ;
20
21
21
22
/**
22
23
* A console command for retrieving information about routes
25
26
*/
26
27
class RouterDebugCommand extends ContainerAwareCommand
27
28
{
29
+ /**
30
+ * {@inheritDoc}
31
+ */
32
+ public function isEnabled ()
33
+ {
34
+ if (!$ this ->getContainer ()->has ('router ' )) {
35
+ return false ;
36
+ }
37
+ $ router = $ this ->getContainer ()->get ('router ' );
38
+ if (!$ router instanceof RouterInterface) {
39
+ return false ;
40
+ }
41
+ return parent ::isEnabled ();
42
+ }
43
+
28
44
/**
29
45
* @see Command
30
46
*/
You can’t perform that action at this time.
0 commit comments