File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
src/Symfony/Bundle/FrameworkBundle/Command Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,28 @@ protected function configure()
58
58
*/
59
59
<
8000
/td> protected function execute (InputInterface $ input , OutputInterface $ output )
60
60
{
61
+ $ dispatcher = $ this ->getEventDispatcher ();
62
+
61
63
if ($ event = $ input ->getArgument ('event ' )) {
64
+ if (!$ dispatcher ->hasListeners ($ event )) {
65
+ $ formatter = $ this ->getHelperSet ()->get ('formatter ' );
66
+
67
+ $ formattedBlock = $ formatter ->formatBlock (
68
+ sprintf ('[NOTE] The event "%s" does not have any registered listeners. ' , $ event ),
69
+ 'fg=yellow ' ,
70
+ true
71
+ );
72
+
73
+ $ output ->writeln ($ formattedBlock );
74
+
75
+ return ;
76
+ }
77
+
62
78
$ options = array ('event ' => $ event );
63
79
} else {
64
80
$ options = array ();
65
81
}
66
82
67
- $ dispatcher = $ this ->getEventDispatcher ();
68
-
69
83
$ helper = new DescriptorHelper ();
70
84
$ options ['format ' ] = $ input ->getOption ('format ' );
71
85
$ options ['raw_text ' ] = $ input ->getOption ('raw ' );
You can’t perform that action at this time.
0 commit comments