Passed
Push — dev ( 79eb06...54fb71 )
by 世昌
02:18
created
suda/src/application/ApplicationSource.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         $group = $group ?? $request->getAttribute('group');
37 37
         $default = $default ?? $request->getAttribute('module');
38 38
         $url = $this->route->create($this->getRouteName($name, $default, $group), $parameter, $allowQuery);
39
-        return $this->getUrlIndex($request) . '/' . ltrim($url, '/');
39
+        return $this->getUrlIndex($request).'/'.ltrim($url, '/');
40 40
     }
41 41
 
42 42
     /**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $module = $default;
71 71
         }
72 72
         if ($module !== null && ($moduleObj = $this->find($module))) {
73
-            return $moduleObj->getFullName() . ':' . $name;
73
+            return $moduleObj->getFullName().':'.$name;
74 74
         }
75 75
         return $name;
76 76
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         }
93 93
         $prefixGroup = $this->getRouteGroupPrefix($group);
94 94
         if ($module !== null && ($moduleObj = $this->find($module))) {
95
-            return $moduleObj->getFullName() . $prefixGroup . ':' . $name;
95
+            return $moduleObj->getFullName().$prefixGroup.':'.$name;
96 96
         }
97 97
         return $name;
98 98
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     public function getUriBase(Request $request, bool $beautify = true): string
135 135
     {
136 136
         $index = $beautify ? $this->getUrlIndex($request) : $request->getIndex();
137
-        return $request->getUriBase() . $index;
137
+        return $request->getUriBase().$index;
138 138
     }
139 139
 
140 140
     /**
@@ -145,6 +145,6 @@  discard block
 block discarded – undo
145 145
      */
146 146
     protected function getRouteGroupPrefix(?string $group): string
147 147
     {
148
-        return $group === null || $group === 'default' ? '' : '@' . $group;
148
+        return $group === null || $group === 'default' ? '' : '@'.$group;
149 149
     }
150 150
 }
Please login to merge, or discard this patch.
suda/src/application/template/ModuleTemplateCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     protected function parseStatic($content)
29 29
     {
30
-        $content = strlen(trim($content)) === 0 ?'()':$content;
30
+        $content = strlen(trim($content)) === 0 ? '()' : $content;
31 31
         return '<?php echo $this->getStaticModulePrefix'.$content.'; ?>';
32 32
     }
33 33
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     protected function parseE($content)
39 39
     {
40
-        $content = strlen(trim($content)) === 0 ?'()':$content;
40
+        $content = strlen(trim($content)) === 0 ? '()' : $content;
41 41
         return '<?php echo $this->application->_'.$content.'; ?>';
42 42
     }
43 43
 }
Please login to merge, or discard this patch.
suda/src/application/template/compiler/Compiler.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
      *
27 27
      * @var Tag[]
28 28
      */
29
-    protected $tags=[];
29
+    protected $tags = [];
30 30
 
31 31
     /**
32 32
      * 命令对象
33 33
      *
34 34
      * @var CommandInterface[]
35 35
      */
36
-    protected $commands=[];
36
+    protected $commands = [];
37 37
 
38 38
     /**
39 39
      * 初始化
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function registerTag(Tag $tag)
83 83
     {
84
-        $this->tags[$tag->getName()] =$tag;
84
+        $this->tags[$tag->getName()] = $tag;
85 85
     }
86 86
 
87 87
     /**
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
     public function compileText(string $text, array $tagConfig = []):string
96 96
     {
97 97
         $this->applyTagConfig($tagConfig);
98
-        $result  = '';
98
+        $result = '';
99 99
         foreach (token_get_all($text) as $token) {
100 100
             if (is_array($token)) {
101 101
                 list($tag, $content) = $token;
102 102
                 // 所有将要编译的文本
103 103
                 // 跳过各种的PHP
104 104
                 if ($tag == T_INLINE_HTML) {
105
-                    $content=$this->processTags($content);
106
-                    $content=$this->processCommands($content);
105
+                    $content = $this->processTags($content);
106
+                    $content = $this->processCommands($content);
107 107
                 }
108 108
                 $result .= $content;
109 109
             } else {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     {
140 140
         foreach ($this->tags as $tag) {
141 141
             $pregExp = sprintf('/(!)?%s\s*(.+?)\s*%s/', preg_quote($tag->getOpen()), preg_quote($tag->getClose()));
142
-            $text = preg_replace_callback($pregExp, function ($match) use ($tag) {
142
+            $text = preg_replace_callback($pregExp, function($match) use ($tag) {
143 143
                 if ($match[1] === '!') {
144 144
                     return substr($match[0], 1);
145 145
                 } else {
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
      */
158 158
     protected function processCommands(string $text):string
159 159
     {
160
-        $pregExp ='/\B\@(\!)?([\w\x{4e00}-\x{9aff}]+)(\s*)(\( ( (?>[^()]+) | (?4) )* \) )? /ux';
161
-        $code = preg_replace_callback($pregExp, [$this,'doMatchCommand'], $text);
160
+        $pregExp = '/\B\@(\!)?([\w\x{4e00}-\x{9aff}]+)(\s*)(\( ( (?>[^()]+) | (?4) )* \) )? /ux';
161
+        $code = preg_replace_callback($pregExp, [$this, 'doMatchCommand'], $text);
162 162
         $error = preg_last_error();
163 163
         if ($error !== PREG_NO_ERROR) {
164 164
             throw new Exception($error);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             list($input, $ignore, $name, $space) = $match;
175 175
             $params = '';
176 176
         }
177
-        if ($ignore ==='!') {
177
+        if ($ignore === '!') {
178 178
             return str_replace('@!', '@', $input);
179 179
         } else {
180 180
             foreach ($this->commands as $command) {
Please login to merge, or discard this patch.