Passed
Push — dev ( 5026e0...59bedf )
by 世昌
02:20
created
suda/src/application/template/CompilableTemplate.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     protected function getStaticOutputPath(?string $name = null)
104 104
     {
105 105
         $public = defined('SUDA_PUBLIC') ? constant('SUDA_PUBLIC') : '.';
106
-        $path = $this->config['assets-public'] ?? $public . '/assets/' . $this->getStaticName($name);
106
+        $path = $this->config['assets-public'] ?? $public.'/assets/'.$this->getStaticName($name);
107 107
         FileSystem::make($path);
108 108
         return $path;
109 109
     }
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
         if ($this->isRaw()) {
119 119
             return $this->source;
120 120
         }
121
-        $output = $this->config['output'] ?? constant('SUDA_DATA') . '/template';
121
+        $output = $this->config['output'] ?? constant('SUDA_DATA').'/template';
122 122
         FileSystem::make($output);
123
-        return $output . '/' . $this->name . '-' . substr(md5_file($this->getSourcePath()), 10, 8) . '.php';
123
+        return $output.'/'.$this->name.'-'.substr(md5_file($this->getSourcePath()), 10, 8).'.php';
124 124
     }
125 125
 
126 126
     /**
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $sourcePath = $this->getSourcePath();
184 184
         if ($sourcePath === null) {
185 185
             throw new NoTemplateFoundException(
186
-                'missing source ' . $this->name,
186
+                'missing source '.$this->name,
187 187
                 E_USER_ERROR,
188 188
                 $this->name,
189 189
                 NoTemplateFoundException::T_SOURCE
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     public function include(string $path)
204 204
     {
205 205
         $subfix = $this->config['subfix'] ?? '';
206
-        $included = new self(Resource::getPathByRelativePath($path . $subfix, dirname($this->source)), $this->config);
206
+        $included = new self(Resource::getPathByRelativePath($path.$subfix, dirname($this->source)), $this->config);
207 207
         $included->parent = $this;
208 208
         echo $included->getRenderedString();
209 209
     }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         } else {
223 223
             $prefix = '/assets';
224 224
         }
225
-        return '/' . ltrim($prefix, '/') . '/' . $this->getStaticName($name);
225
+        return '/'.ltrim($prefix, '/').'/'.$this->getStaticName($name);
226 226
     }
227 227
 
228 228
     /**
Please login to merge, or discard this patch.
suda/src/application/template/RawTemplate.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                 }
159 159
             }
160 160
         } catch (Exception $e) {
161
-            echo '<div style="color:red">' . $e->getMessage() . '</div>';
161
+            echo '<div style="color:red">'.$e->getMessage().'</div>';
162 162
             return;
163 163
         }
164 164
     }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             return ob_get_clean() ?: '';
180 180
         }
181 181
         throw new NoTemplateFoundException(
182
-            'missing dest at ' . $this->getPath(),
182
+            'missing dest at '.$this->getPath(),
183 183
             E_USER_ERROR,
184 184
             $this->getPath(),
185 185
             1
Please login to merge, or discard this patch.
suda/src/application/template/ModuleTemplate.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         $subfix = $this->config['subfix'] ?? '.tpl.html';
23 23
         return $this
24 24
             ->getResource($this->module)
25
-            ->getResourcePath($this->getTemplatePath() . '/' . $this->name . $subfix);
25
+            ->getResourcePath($this->getTemplatePath().'/'.$this->name.$subfix);
26 26
     }
27 27
 
28 28
     /**
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function getPath()
34 34
     {
35
-        $output = $this->config['output'] ?? $this->application->getDataPath() . '/template/' . $this->uriName;
35
+        $output = $this->config['output'] ?? $this->application->getDataPath().'/template/'.$this->uriName;
36 36
         FileSystem::make($output);
37
-        return $output . '/' . $this->name . '.php';
37
+        return $output.'/'.$this->name.'.php';
38 38
     }
39 39
 
40 40
     /**
@@ -58,18 +58,18 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function getRenderedString()
60 60
     {
61
-        $this->application->debug()->time('render ' . $this->name);
61
+        $this->application->debug()->time('render '.$this->name);
62 62
         $code = parent::getRenderedString();
63
-        $this->application->debug()->timeEnd('render ' . $this->name);
63
+        $this->application->debug()->timeEnd('render '.$this->name);
64 64
         return $code;
65 65
     }
66 66
 
67 67
     protected function compile()
68 68
     {
69 69
         if ($this->isCompiled() === false) {
70
-            $this->application->debug()->time('compile ' . $this->name);
70
+            $this->application->debug()->time('compile '.$this->name);
71 71
             $result = parent::compile();
72
-            $this->application->debug()->timeEnd('compile ' . $this->name);
72
+            $this->application->debug()->timeEnd('compile '.$this->name);
73 73
             return $result;
74 74
         }
75 75
         return true;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             }
108 108
             return $this->application->getUrl($this->request, $name, $values ?? [], true, $this->module, $this->group);
109 109
         } elseif (is_string($defaultName)) {
110
-            $parameter = is_array($name)?array_merge($query, $name):$query;
110
+            $parameter = is_array($name) ?array_merge($query, $name) : $query;
111 111
             return $this->application->getUrl(
112 112
                 $this->request,
113 113
                 $defaultName,
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 $this->group
118 118
             );
119 119
         }
120
-        return '#' . $defaultName;
120
+        return '#'.$defaultName;
121 121
     }
122 122
 
123 123
 
Please login to merge, or discard this patch.