Completed
Push — 6.0 ( 6217ae...a4f199 )
by liu
07:00
created
src/think/Route.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think;
14 14
 
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
         $this->ruleName = new RuleName();
171 171
         $this->setDefaultDomain();
172 172
 
173
-        if (is_file($this->app->getRuntimePath() . 'route.php')) {
173
+        if (is_file($this->app->getRuntimePath().'route.php')) {
174 174
             // 读取路由映射文件
175
-            $this->import(include $this->app->getRuntimePath() . 'route.php');
175
+            $this->import(include $this->app->getRuntimePath().'route.php');
176 176
         }
177 177
     }
178 178
 
@@ -406,14 +406,14 @@  discard block
 block discarded – undo
406 406
         if (is_null($domain)) {
407 407
             $domain = $this->host;
408 408
         } elseif (false === strpos($domain, '.') && $this->request) {
409
-            $domain .= '.' . $this->request->rootDomain();
409
+            $domain .= '.'.$this->request->rootDomain();
410 410
         }
411 411
 
412 412
         if ($this->request) {
413 413
             $subDomain = $this->request->subDomain();
414 414
 
415 415
             if (strpos($subDomain, '.')) {
416
-                $name = '*' . strstr($subDomain, '.');
416
+                $name = '*'.strstr($subDomain, '.');
417 417
             }
418 418
         }
419 419
 
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
         $this->init();
747 747
 
748 748
         if ($withRoute) {
749
-            $checkCallback = function () use ($withRoute) {
749
+            $checkCallback = function() use ($withRoute) {
750 750
                 //加载路由
751 751
                 $withRoute();
752 752
                 return $this->check();
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
 
768 768
         return $this->app->middleware->pipeline('route')
769 769
             ->send($request)
770
-            ->then(function () use ($dispatch) {
770
+            ->then(function() use ($dispatch) {
771 771
                 return $dispatch->run();
772 772
             });
773 773
     }
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
             $closure  = $this->config['route_check_cache_key'];
785 785
             $routeKey = $closure($request);
786 786
         } else {
787
-            $routeKey = md5($request->baseUrl(true) . ':' . $request->method());
787
+            $routeKey = md5($request->baseUrl(true).':'.$request->method());
788 788
         }
789 789
 
790 790
         return $routeKey;
@@ -834,10 +834,10 @@  discard block
 block discarded – undo
834 834
             $path = $pathinfo;
835 835
         } elseif ($suffix) {
836 836
             // 去除正常的URL后缀
837
-            $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo);
837
+            $path = preg_replace('/\.('.ltrim($suffix, '.').')$/i', '', $pathinfo);
838 838
         } else {
839 839
             // 允许任何后缀访问
840
-            $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo);
840
+            $path = preg_replace('/\.'.$this->request->ext().'$/i', '', $pathinfo);
841 841
         }
842 842
 
843 843
         return $path;
@@ -880,9 +880,9 @@  discard block
 block discarded – undo
880 880
                 $item = $this->domains[$this->host];
881 881
             } elseif (isset($this->domains[$subDomain])) {
882 882
                 $item = $this->domains[$subDomain];
883
-            } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) {
883
+            } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) {
884 884
                 // 泛三级域名
885
-                $item      = $this->domains['*.' . $domain2];
885
+                $item      = $this->domains['*.'.$domain2];
886 886
                 $panDomain = $domain3;
887 887
             } elseif (isset($this->domains['*']) && !empty($domain2)) {
888 888
                 // 泛二级域名
Please login to merge, or discard this patch.