Completed
Push — 6.0 ( daf661...d2dea0 )
by yun
05:42
created
src/think/Console.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 // +----------------------------------------------------------------------
7 7
 // | Author: zhangyajun <[email protected]>
8 8
 // +----------------------------------------------------------------------
9
-declare (strict_types = 1);
9
+declare(strict_types=1);
10 10
 
11 11
 namespace think;
12 12
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
         $command = $this->find($name);
260 260
 
261
-        $this->app->log->info('run: php think ' . $input);
261
+        $this->app->log->info('run: php think '.$input);
262 262
 
263 263
         return $this->doRunCommand($command, $input, $output);
264 264
     }
@@ -463,10 +463,10 @@  discard block
 block discarded – undo
463 463
     public function findNamespace(string $namespace): string
464 464
     {
465 465
         $allNamespaces = $this->getNamespaces();
466
-        $expr          = preg_replace_callback('{([^:]+|)}', function ($matches) {
467
-            return preg_quote($matches[1]) . '[^:]*';
466
+        $expr          = preg_replace_callback('{([^:]+|)}', function($matches) {
467
+            return preg_quote($matches[1]).'[^:]*';
468 468
         }, $namespace);
469
-        $namespaces    = preg_grep('{^' . $expr . '}', $allNamespaces);
469
+        $namespaces    = preg_grep('{^'.$expr.'}', $allNamespaces);
470 470
 
471 471
         if (empty($namespaces)) {
472 472
             $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace);
@@ -503,13 +503,13 @@  discard block
 block discarded – undo
503 503
     {
504 504
         $allCommands = array_keys($this->commands);
505 505
 
506
-        $expr = preg_replace_callback('{([^:]+|)}', function ($matches) {
507
-            return preg_quote($matches[1]) . '[^:]*';
506
+        $expr = preg_replace_callback('{([^:]+|)}', function($matches) {
507
+            return preg_quote($matches[1]).'[^:]*';
508 508
         }, $name);
509 509
 
510
-        $commands = preg_grep('{^' . $expr . '}', $allCommands);
510
+        $commands = preg_grep('{^'.$expr.'}', $allCommands);
511 511
 
512
-        if (empty($commands) || count(preg_grep('{^' . $expr . '$}', $commands)) < 1) {
512
+        if (empty($commands) || count(preg_grep('{^'.$expr.'$}', $commands)) < 1) {
513 513
             if (false !== $pos = strrpos($name, ':')) {
514 514
                 $this->findNamespace(substr($name, 0, $pos));
515 515
             }
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
             }
704 704
         }
705 705
 
706
-        $alternatives = array_filter($alternatives, function ($lev) use ($threshold) {
706
+        $alternatives = array_filter($alternatives, function($lev) use ($threshold) {
707 707
             return $lev < 2 * $threshold;
708 708
         });
709 709
         asort($alternatives);
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 
725 725
         foreach ($parts as $part) {
726 726
             if (count($namespaces)) {
727
-                $namespaces[] = end($namespaces) . ':' . $part;
727
+                $namespaces[] = end($namespaces).':'.$part;
728 728
             } else {
729 729
                 $namespaces[] = $part;
730 730
             }
Please login to merge, or discard this patch.