Completed
Branch master (428a72)
by Ivannis Suárez
10:09
created
ConsoleApplication.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
     /**
70 70
      * @param ApplicationConfig|callable $config
71 71
      *
72
-     * @return ApplicationConfig|callable
72
+     * @return ApplicationConfig
73 73
      */
74 74
     protected function normalizeConfig($config)
75 75
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
         );
88 88
 
89 89
         // add listener
90
-        $configuration->addEventListener(ConsoleEvents::PRE_HANDLE, function (PreHandleEvent $event) {
90
+        $configuration->addEventListener(ConsoleEvents::PRE_HANDLE, function(PreHandleEvent $event) {
91 91
             $this->onPreHandle($event);
92 92
         });
93 93
 
Please login to merge, or discard this patch.
Handler/DefaultEventHandler.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
     /**
164 164
      * @param EventInterface $event
165 165
      *
166
-     * @return array
166
+     * @return string
167 167
      */
168 168
     protected function eventToString(EventInterface $event)
169 169
     {
Please login to merge, or discard this patch.
Config/DefaultApplicationConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
                 ->addOption('text', 't', Option::NO_VALUE, 'Output the help as plain text')
73 73
                 ->addOption('xml', 'x', Option::NO_VALUE, 'Output the help as XML')
74 74
                 ->addOption('json', 'j', Option::NO_VALUE, 'Output the help as JSON')
75
-                ->setHandler(function () {
75
+                ->setHandler(function() {
76 76
                     return new HelpHandler();
77 77
                 })
78 78
             ->end()
Please login to merge, or discard this patch.
Tests/Units/ConsoleApplicationTests.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $config = new ApplicationConfig();
91 91
         $config->setCatchExceptions(false);
92 92
         $config->setTerminateAfterRun(false);
93
-        $config->setIOFactory(function ($application, $args, $inputStream, $outputStream, $errorStream) {
93
+        $config->setIOFactory(function($application, $args, $inputStream, $outputStream, $errorStream) {
94 94
             return new IO(new Input($inputStream), new Output($outputStream), new Output($errorStream));
95 95
         });
96 96
 
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function testRunHelpCommand()
123 123
     {
124
-        $configCallback = function (ApplicationConfig $config) {
124
+        $configCallback = function(ApplicationConfig $config) {
125 125
             $config
126 126
                 ->beginCommand('help')
127 127
                     ->markDefault()
128
-                    ->setHandler(function () {
128
+                    ->setHandler(function() {
129 129
                         return new HelpHandler();
130 130
                     })
131 131
                 ->end()
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $this
150 150
             ->given($config = $this->createConfiguration())
151 151
             ->and($configCallback($config))
152
-            ->and($application = $this->createApplication(function () use ($config) {
152
+            ->and($application = $this->createApplication(function() use ($config) {
153 153
                 return $config;
154 154
             }))
155 155
             ->and($args = new ArgvArgs(array('test', 'help')))
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function testRunHelpSubCommand()
170 170
     {
171
-        $configCallback = function (ApplicationConfig $config) {
171
+        $configCallback = function(ApplicationConfig $config) {
172 172
             $config
173 173
                 ->beginCommand('post')
174 174
                     ->setDescription('Manage posts')
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 ->beginCommand('help')
185 185
                     ->markDefault()
186 186
                     ->addArgument('command', Argument::OPTIONAL, 'The command name')
187
-                    ->setHandler(function () {
187
+                    ->setHandler(function() {
188 188
                         return new HelpHandler();
189 189
                     })
190 190
                 ->end()
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
      */
212 212
     public function testRunCommandWithoutClass()
213 213
     {
214
-        $configCallback = function (ApplicationConfig $config) {
214
+        $configCallback = function(ApplicationConfig $config) {
215 215
             $config
216 216
                 ->beginCommand('create-blog')
217 217
                     ->setDescription('Create a new blog')
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
             ->and($output = new BufferedOutputStream())
230 230
             ->and($errorOutput = new BufferedOutputStream())
231 231
             ->then()
232
-                ->exception(function () use ($application, $args, $input, $output, $errorOutput) {
232
+                ->exception(function() use ($application, $args, $input, $output, $errorOutput) {
233 233
                     $application->run($args, $input, $output, $errorOutput);
234 234
                 })
235 235
                 ->isInstanceOf(\RuntimeException::class)
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     public function testRunCommandWithoutArguments()
243 243
     {
244
-        $configCallback = function (ApplicationConfig $config) {
244
+        $configCallback = function(ApplicationConfig $config) {
245 245
             $config
246 246
                 ->beginCommand('create-blog')
247 247
                     ->setDescription('Create a new blog')
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             ->and($output = new BufferedOutputStream())
261 261
             ->and($errorOutput = new BufferedOutputStream())
262 262
             ->then()
263
-                ->exception(function () use ($application, $args, $input, $output, $errorOutput) {
263
+                ->exception(function() use ($application, $args, $input, $output, $errorOutput) {
264 264
                     $application->run($args, $input, $output, $errorOutput);
265 265
                 })
266 266
                 ->isInstanceOf(\InvalidArgumentException::class)
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public function testRunCommandWithDefaultHanlder()
274 274
     {
275
-        $configCallback = function (ApplicationConfig $config) {
275
+        $configCallback = function(ApplicationConfig $config) {
276 276
             $config
277 277
                 ->beginCommand('create-blog')
278 278
                     ->setDescription('Create a new blog')
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public function testRunCommandWithCustomPreDispatchHanlder()
306 306
     {
307
-        $configCallback = function (ApplicationConfig $config) {
307
+        $configCallback = function(ApplicationConfig $config) {
308 308
             $config
309 309
                 ->beginCommand('post')
310 310
                     ->setDescription('Manage posts')
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                         ->setDescription('Create a new post')
314 314
                         ->addArgument('title', Argument::REQUIRED | Argument::STRING, 'The post title')
315 315
                         ->addArgument('content', Argument::OPTIONAL, 'The post content')
316
-                        ->onPreDispatchEvent(function (EventInterface $event, IO $io) {
316
+                        ->onPreDispatchEvent(function(EventInterface $event, IO $io) {
317 317
                             $io->writeLine('on pre dispatch');
318 318
                         })
319 319
                     ->end()
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
                         ->setClass(ChangePostTitleCommand::class)
322 322
                         ->setDescription('Change the post title')
323 323
                         ->addArgument('title', Argument::REQUIRED | Argument::STRING, 'The new post title')
324
-                        ->onPostDispatchEvent(function (EventInterface $event, IO $io) {
324
+                        ->onPostDispatchEvent(function(EventInterface $event, IO $io) {
325 325
                             $io->writeLine('on post dispatch');
326 326
                         })
327 327
                     ->end()
Please login to merge, or discard this patch.