Test Failed
Branch master (fb3e9d)
by 世昌
03:53
created
nebula/route/RouteMatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * 可执行命令表达式
6 6
  *
7 7
  */
8
-class RouteMatcher   {
8
+class RouteMatcher {
9 9
     /**
10 10
      * 匹配的URI
11 11
      *
Please login to merge, or discard this patch.
nebula/route/uri/UriMatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      * @param boolean $ignoreCase
36 36
      * @return array|null
37 37
      */
38
-    public function match(string $url, bool $ignoreCase = true):?array
38
+    public function match(string $url, bool $ignoreCase = true): ?array
39 39
     {
40
-        $match = '#^'. $this->match.'$#'. ($ignoreCase?'i':'');
40
+        $match = '#^'.$this->match.'$#'.($ignoreCase ? 'i' : '');
41 41
         if (preg_match($match, $url, $parameter)) {
42 42
             array_shift($parameter);
43 43
             return $parameter;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
             } else {
61 61
                 $value = $parameter->getDefaultValue();
62 62
             }
63
-            $parameters[$parameter->getIndexName()] =  $value;
63
+            $parameters[$parameter->getIndexName()] = $value;
64 64
         }
65 65
         return $parameters;
66 66
     }
Please login to merge, or discard this patch.
nebula/route/uri/MatchBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,18 +26,18 @@
 block discarded – undo
26 26
         // 参数
27 27
         $parameters = [];
28 28
         // 转义正则
29
-        $url=preg_replace('/([\/\.\\\\\+\(\^\)\$\!\<\>\-\?\*])/', '\\\\$1', $uri);
29
+        $url = preg_replace('/([\/\.\\\\\+\(\^\)\$\!\<\>\-\?\*])/', '\\\\$1', $uri);
30 30
         // 添加忽略
31
-        $url=preg_replace('/(\[)([^\[\]]+)(?(1)\])/', '(?:$2)?', $url);
31
+        $url = preg_replace('/(\[)([^\[\]]+)(?(1)\])/', '(?:$2)?', $url);
32 32
         // 添加 * ? 匹配
33
-        $url=str_replace(['\*','\?'],['[^/]+?','[^/]'], $url);
33
+        $url = str_replace(['\*', '\?'], ['[^/]+?', '[^/]'], $url);
34 34
         // 编译页面参数
35
-        $url=preg_replace_callback('/\{(\w+)(?:\:([^}]+?))?\}/', function ($match) use (&$parameters) {
35
+        $url = preg_replace_callback('/\{(\w+)(?:\:([^}]+?))?\}/', function($match) use (&$parameters) {
36 36
             $name = $match[1];
37 37
             $type = 'string';
38 38
             $extra = '';
39 39
             if (isset($match[2])) {
40
-                if (strpos($match[2], '=')!==false) {
40
+                if (strpos($match[2], '=') !== false) {
41 41
                     list($type, $extra) = \explode('=', $match[2]);
42 42
                 } else {
43 43
                     $type = $match[2];
Please login to merge, or discard this patch.
nebula/route/uri/parameter/Parameter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 /**
5 5
  * 匹配参数
6 6
  */
7
-abstract class Parameter   {
7
+abstract class Parameter {
8 8
 
9 9
     protected static $name;
10 10
     /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     }
26 26
 
27 27
     public static function build(string $indexName, string $extra):Parameter {
28
-        $parameter =  new static($extra);
28
+        $parameter = new static($extra);
29 29
         $parameter->setIndexName($indexName);
30 30
         return $parameter;
31 31
     }
Please login to merge, or discard this patch.