Completed
Pull Request — master (#86)
by Greg
02:32
created
src/AnnotatedCommandFactory.php 3 patches
Doc Comments   +9 added lines, -1 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
      * store that does not itself depend on the annotated-command library.
221 221
      *
222 222
      * @param Mixed $dataStore
223
-     * @return type
223
+     * @return AnnotatedCommandFactory
224 224
      */
225 225
     public function setDataStore($dataStore)
226 226
     {
@@ -301,6 +301,10 @@  discard block
 block discarded – undo
301 301
         return array_filter($commandInfoList, $commandSelector);
302 302
     }
303 303
 
304
+    /**
305
+     * @param CommandInfo $commandInfo
306
+     * @param boolean $includeAllPublicMethods
307
+     */
304 308
     public static function isCommandOrHookMethod($commandInfo, $includeAllPublicMethods)
305 309
     {
306 310
         return static::isHookMethod($commandInfo) || static::isCommandMethod($commandInfo, $includeAllPublicMethods);
@@ -381,6 +385,10 @@  discard block
 block discarded – undo
381 385
         }
382 386
     }
383 387
 
388
+    /**
389
+     * @param string $string
390
+     * @param integer $n
391
+     */
384 392
     protected function getNthWord($string, $n, $default = '', $delimiter = ' ')
385 393
     {
386 394
         $words = explode($delimiter, $string);
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -10,9 +10,6 @@
 block discarded – undo
10 10
 use Consolidation\AnnotatedCommand\Parser\CommandInfoDeserializer;
11 11
 use Consolidation\AnnotatedCommand\Parser\CommandInfoSerializer;
12 12
 use Consolidation\OutputFormatters\Options\FormatterOptions;
13
-use Symfony\Component\Console\Command\Command;
14
-use Symfony\Component\Console\Input\InputInterface;
15
-use Symfony\Component\Console\Output\OutputInterface;
16 13
 
17 14
 /**
18 15
  * The AnnotatedCommandFactory creates commands for your application.
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
         // can never be commands.
248 248
         $commandMethodNames = array_filter(
249 249
             get_class_methods($classNameOrInstance) ?: [],
250
-            function ($m) {
250
+            function($m) {
251 251
                 return !preg_match('#^_#', $m);
252 252
             }
253 253
         );
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                 if (!static::isCommandOrHookMethod($commandInfo, $this->getIncludeAllPublicMethods())) {
259 259
                     $commandInfo->invalidate();
260 260
                 }
261
-                $commandInfoList[$commandMethodName] =  $commandInfo;
261
+                $commandInfoList[$commandMethodName] = $commandInfo;
262 262
             }
263 263
         }
264 264
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         return $this->createSelectedCommandsFromClassInfo(
280 280
             $commandInfoList,
281 281
             $commandFileInstance,
282
-            function ($commandInfo) use ($includeAllPublicMethods) {
282
+            function($commandInfo) use ($includeAllPublicMethods) {
283 283
                 return static::isCommandMethod($commandInfo, $includeAllPublicMethods);
284 284
             }
285 285
         );
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     {
290 290
         $commandInfoList = $this->filterCommandInfoList($commandInfoList, $commandSelector);
291 291
         return array_map(
292
-            function ($commandInfo) use ($commandFileInstance) {
292
+            function($commandInfo) use ($commandFileInstance) {
293 293
                 return $this->createCommand($commandInfo, $commandFileInstance);
294 294
             },
295 295
             $commandInfoList
Please login to merge, or discard this patch.