@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | public function getDataSourceGroup(string $groupName):DataSource |
86 | 86 | { |
87 | - $group = $groupName === 'default' ? '': '-'. $groupName; |
|
87 | + $group = $groupName === 'default' ? '' : '-'.$groupName; |
|
88 | 88 | $dataSourceConfigPath = $this->application->getResource()->getConfigResourcePath('config/data-source'.$group); |
89 | 89 | $dataSource = new DataSource; |
90 | 90 | $observer = new DebugObserver($this->application->debug()); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | protected function registerModule() |
123 | 123 | { |
124 | - $extractPath = SUDA_DATA .'/extract-module'; |
|
124 | + $extractPath = SUDA_DATA.'/extract-module'; |
|
125 | 125 | FileSystem::make($extractPath); |
126 | 126 | foreach ($this->application->getModulePaths() as $path) { |
127 | 127 | $this->registerModuleFrom($path, $extractPath); |
@@ -19,9 +19,9 @@ |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | use FileHelper { |
22 | - delete as protected deleteFile; |
|
23 | - FileHelper::copy insteadof DirectoryHelper; |
|
24 | - FileHelper::move insteadof DirectoryHelper; |
|
22 | + delete as protected deleteFile; |
|
23 | + FileHelper::copy insteadof DirectoryHelper; |
|
24 | + FileHelper::move insteadof DirectoryHelper; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -15,13 +15,13 @@ |
||
15 | 15 | |
16 | 16 | protected function parseStatic($content) |
17 | 17 | { |
18 | - $content = strlen(trim($content)) === 0 ?'()':$content; |
|
18 | + $content = strlen(trim($content)) === 0 ? '()' : $content; |
|
19 | 19 | return '<?php echo $this->getStaticModulePrefix'.$content.'; ?>'; |
20 | 20 | } |
21 | 21 | |
22 | 22 | protected function parseFile($content) |
23 | 23 | { |
24 | - $content = strlen(trim($content)) === 0 ?'()':$content; |
|
24 | + $content = strlen(trim($content)) === 0 ? '()' : $content; |
|
25 | 25 | return '<?php echo $this->getModulePrefix'.$content.'; ?>'; |
26 | 26 | } |
27 | 27 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | protected function getModuleStaticOutpath(?string $module) |
97 | 97 | { |
98 | 98 | $config = $this->getModuleConfig($module); |
99 | - $path = $config['assets-path'].'/'. $this->getModuleUriName($module) .'/'.$config['static']; |
|
99 | + $path = $config['assets-path'].'/'.$this->getModuleUriName($module).'/'.$config['static']; |
|
100 | 100 | FileSystem::make($path); |
101 | 101 | return $path; |
102 | 102 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | $this->prepareStaticModuleSource($module); |
126 | 126 | $config = TemplateUtil::getConfig($this->application, $module); |
127 | - return $this->getModuleStaticAssetRoot($module) .'/'.$this->getModuleUriName($module). '/'.$config['static']; |
|
127 | + return $this->getModuleStaticAssetRoot($module).'/'.$this->getModuleUriName($module).'/'.$config['static']; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | protected function getModulePrefix(?string $module = null) |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | if ($module === null) { |
133 | 133 | $module = $this->module; |
134 | 134 | } |
135 | - return $this->getModuleAssetRoot($module) .'/'.$this->getModuleUriName($module); |
|
135 | + return $this->getModuleAssetRoot($module).'/'.$this->getModuleUriName($module); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | protected function getModuleAssetRoot(?string $module) |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function __construct(DataSource $datasource) |
12 | 12 | { |
13 | 13 | parent::__construct('hello'); |
14 | - (new MySQLTableCreator($this->getSource()->write(),$this->getStruct()->getFields()))->create(); |
|
14 | + (new MySQLTableCreator($this->getSource()->write(), $this->getStruct()->getFields()))->create(); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function onCreateStruct(TableStruct $struct):TableStruct |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | public function packValue(?string $matched) |
26 | 26 | { |
27 | - return $matched ? urlencode($matched): ''; |
|
27 | + return $matched ? urlencode($matched) : ''; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | protected function loadRouteGroup(string $groupName) |
182 | 182 | { |
183 | - $group = $groupName === 'default' ? '': '-'. $groupName; |
|
183 | + $group = $groupName === 'default' ? '' : '-'.$groupName; |
|
184 | 184 | if ($path = $this->module->getResource()->getConfigResourcePath('config/route'.$group)) { |
185 | 185 | $routeConfig = Config::loadConfig($path, [ |
186 | 186 | 'module' => $this->module->getName(), |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | */ |
205 | 205 | protected function loadRouteConfig(string $prefix, string $groupName, array $routeConfig) |
206 | 206 | { |
207 | - $module = $this->module->getFullName(); |
|
207 | + $module = $this->module->getFullName(); |
|
208 | 208 | foreach ($routeConfig as $name => $config) { |
209 | 209 | $exname = $this->application->getRouteName($name, $module, $groupName); |
210 | 210 | $method = $config['method'] ?? []; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | if ($anti) { |
219 | 219 | $uri = '/'.trim($uri, '/'); |
220 | 220 | } else { |
221 | - $uri = '/'.trim($prefix . $uri, '/'); |
|
221 | + $uri = '/'.trim($prefix.$uri, '/'); |
|
222 | 222 | } |
223 | 223 | $this->application->request($method, $exname, $uri, $attriute); |
224 | 224 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function __construct(string $name, int $type = 0) |
14 | 14 | { |
15 | 15 | $this->name = $name; |
16 | - parent::__construct(sprintf('missing template %s', $name, $type == 0 ? 'source':'dest')); |
|
16 | + parent::__construct(sprintf('missing template %s', $name, $type == 0 ? 'source' : 'dest')); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if (array_key_exists('server-port', $this->request->server())) { |
99 | 99 | return $this->request->server()['server-port']; |
100 | 100 | } |
101 | - return $this->getSecure()?443:80; |
|
101 | + return $this->getSecure() ? 443 : 80; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | private function createUribase(Request $request) |
140 | 140 | { |
141 | - $scheme = $request->isSecure()?'https':'http'; |
|
141 | + $scheme = $request->isSecure() ? 'https' : 'http'; |
|
142 | 142 | $port = $request->getPort(); |
143 | 143 | if ($port == 80 && $scheme == 'http') { |
144 | 144 | $port = ''; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } else { |
148 | 148 | $port = ':'.$port; |
149 | 149 | } |
150 | - $base = $scheme.'://'. $request->getHost().$port; |
|
150 | + $base = $scheme.'://'.$request->getHost().$port; |
|
151 | 151 | $request->setUribase($base); |
152 | 152 | } |
153 | 153 | } |