@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | $replace = []; |
68 | 68 | foreach ($context as $key => $val) { |
69 | - $replace['{' . $key . '}'] = $val; |
|
69 | + $replace['{'.$key.'}'] = $val; |
|
70 | 70 | } |
71 | 71 | return strtr($message, $replace); |
72 | 72 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); |
90 | 90 | $pos = min($pow, count($human) - 1); |
91 | 91 | $bytes /= (1 << (10 * $pos)); |
92 | - return round($bytes, $precision) . ' ' . $human[$pos]; |
|
92 | + return round($bytes, $precision).' '.$human[$pos]; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function time(string $name, string $type = LogLevel::INFO) |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | $this->debug->info('==============================='); |
43 | 43 | $this->debug->time('loading application'); |
44 | 44 | $appLoader->load(); |
45 | - $this->event->exec('application:load-config', [ $this->config ,$this]); |
|
45 | + $this->event->exec('application:load-config', [$this->config, $this]); |
|
46 | 46 | $this->debug->timeEnd('loading application'); |
47 | 47 | $this->debug->time('loading data-source'); |
48 | 48 | $appLoader->loadDataSource(); |
49 | 49 | $this->debug->timeEnd('loading data-source'); |
50 | 50 | Table::load($this); |
51 | 51 | DataAccess::load($this); |
52 | - $this->event->exec('application:load-environment', [ $this->config ,$this]); |
|
52 | + $this->event->exec('application:load-environment', [$this->config, $this]); |
|
53 | 53 | $this->debug->time('loading route'); |
54 | 54 | $appLoader->loadRoute(); |
55 | - $this->event->exec('application:load-route', [$this->route , $this]); |
|
55 | + $this->event->exec('application:load-route', [$this->route, $this]); |
|
56 | 56 | $this->debug->timeEnd('loading route'); |
57 | 57 | $this->debug->info('-------------------------------'); |
58 | 58 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if (!$response->isSend()) { |
110 | 110 | $response->end(); |
111 | 111 | } |
112 | - $this->debug->info('responded with code '. $response->getStatus()); |
|
112 | + $this->debug->info('responded with code '.$response->getStatus()); |
|
113 | 113 | $this->debug->timeEnd('sending response'); |
114 | 114 | } catch (Throwable $e) { |
115 | 115 | $this->debug->uncaughtException($e); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | protected function createResponse(?MatchResult $result, Request $request, Response $response) |
178 | 178 | { |
179 | 179 | if (SUDA_DEBUG) { |
180 | - $response->setHeader('x-route', $result === null?'default':$result->getName()); |
|
180 | + $response->setHeader('x-route', $result === null ? 'default' : $result->getName()); |
|
181 | 181 | } |
182 | 182 | if ($result === null) { |
183 | 183 | $content = $this->defaultResponse($this, $request, $response); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | foreach ($this->application->getModules() as $name => $module) { |
54 | 54 | if ($module->getStatus() === Module::REACHABLE) { |
55 | - call_user_func([$this->moduleLoader[$name],'toReachable']); |
|
55 | + call_user_func([$this->moduleLoader[$name], 'toReachable']); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function getDataSourceGroup(string $groupName):DataSource |
95 | 95 | { |
96 | - $group = $groupName === 'default' ? '': '-'. $groupName; |
|
96 | + $group = $groupName === 'default' ? '' : '-'.$groupName; |
|
97 | 97 | $dataSourceConfigPath = $this->application->getResource()->getConfigResourcePath('config/data-source'.$group); |
98 | 98 | $dataSource = new DataSource; |
99 | 99 | $observer = new DebugObserver($this->application->debug()); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | protected function registerModule() |
163 | 163 | { |
164 | - $extractPath = SUDA_DATA .'/extract-module'; |
|
164 | + $extractPath = SUDA_DATA.'/extract-module'; |
|
165 | 165 | FileSystem::make($extractPath); |
166 | 166 | foreach ($this->application->getModulePaths() as $path) { |
167 | 167 | $this->registerModuleFrom($path, $extractPath); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | $config = $config ?? []; |
189 | 189 | $moduleNames = array_keys($modules->all()); |
190 | - $load = $config['load'] ?? $moduleNames; |
|
190 | + $load = $config['load'] ?? $moduleNames; |
|
191 | 191 | $this->loadModules($modules, $load); |
192 | 192 | $active = $config['active'] ?? $load; |
193 | 193 | $this->setModuleActive($modules, $active); |