@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function handle() |
| 23 | 23 | { |
| 24 | - $action = (string)$this->argument('action'); |
|
| 24 | + $action = (string) $this->argument('action'); |
|
| 25 | 25 | switch ($action) { |
| 26 | 26 | case 'publish': |
| 27 | 27 | $this->publish(); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | // Load configuration laravel.php manually for Lumen |
| 55 | 55 | $basePath = config('laravels.laravel_base_path') ?: base_path(); |
| 56 | - if ($this->isLumen() && file_exists($basePath . '/config/laravels.php')) { |
|
| 56 | + if ($this->isLumen() && file_exists($basePath.'/config/laravels.php')) { |
|
| 57 | 57 | $this->getLaravel()->configure('laravels'); |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $this->comment('>>> Components'); |
| 87 | 87 | $laravelSVersion = '-'; |
| 88 | - $cfg = (array)json_decode(file_get_contents(base_path('composer.lock')), true); |
|
| 88 | + $cfg = (array) json_decode(file_get_contents(base_path('composer.lock')), true); |
|
| 89 | 89 | if (isset($cfg['packages'])) { |
| 90 | 90 | $packages = array_merge($cfg['packages'], Arr::get($cfg, 'packages-dev', [])); |
| 91 | 91 | foreach ($packages as $package) { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $laravelSVersion, |
| 110 | 110 | ], |
| 111 | 111 | [ |
| 112 | - $this->getApplication()->getName() . ' [<info>' . env('APP_ENV', config('app.env')) . '</info>]', |
|
| 112 | + $this->getApplication()->getName().' [<info>'.env('APP_ENV', config('app.env')).'</info>]', |
|
| 113 | 113 | $this->getApplication()->getVersion(), |
| 114 | 114 | ], |
| 115 | 115 | ]); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | { |
| 120 | 120 | $this->comment('>>> Protocols'); |
| 121 | 121 | |
| 122 | - $config = (array)json_decode(file_get_contents(base_path('storage/laravels.json')), true); |
|
| 122 | + $config = (array) json_decode(file_get_contents(base_path('storage/laravels.json')), true); |
|
| 123 | 123 | $socketType = isset($config['server']['socket_type']) ? $config['server']['socket_type'] : SWOOLE_SOCK_TCP; |
| 124 | 124 | if (in_array($socketType, [SWOOLE_SOCK_UNIX_DGRAM, SWOOLE_SOCK_UNIX_STREAM])) { |
| 125 | 125 | $listenAt = $config['server']['listen_ip']; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | continue; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - $name = 'Port#' . $key . ' '; |
|
| 161 | + $name = 'Port#'.$key.' '; |
|
| 162 | 162 | $name .= isset($socketTypeNames[$socket['type']]) ? $socketTypeNames[$socket['type']] : 'Unknown socket'; |
| 163 | 163 | $tableRows [] = [ |
| 164 | 164 | $name, |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | $laravelConf = [ |
| 187 | 187 | 'root_path' => $svrConf['laravel_base_path'], |
| 188 | 188 | 'static_path' => $svrConf['swoole']['document_root'], |
| 189 | - 'cleaners' => array_unique((array)Arr::get($svrConf, 'cleaners', [])), |
|
| 190 | - 'register_providers' => array_unique((array)Arr::get($svrConf, 'register_providers', [])), |
|
| 189 | + 'cleaners' => array_unique((array) Arr::get($svrConf, 'cleaners', [])), |
|
| 190 | + 'register_providers' => array_unique((array) Arr::get($svrConf, 'register_providers', [])), |
|
| 191 | 191 | 'destroy_controllers' => Arr::get($svrConf, 'destroy_controllers', []), |
| 192 | 192 | 'is_lumen' => $this->isLumen(), |
| 193 | 193 | '_SERVER' => $_SERVER, |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $svrConf['ignore_check_pid'] = false; |
| 217 | 217 | } |
| 218 | 218 | if (empty($svrConf['swoole']['document_root'])) { |
| 219 | - $svrConf['swoole']['document_root'] = $svrConf['laravel_base_path'] . '/public'; |
|
| 219 | + $svrConf['swoole']['document_root'] = $svrConf['laravel_base_path'].'/public'; |
|
| 220 | 220 | } |
| 221 | 221 | if ($this->option('daemonize')) { |
| 222 | 222 | $svrConf['swoole']['daemonize'] = true; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | // Set X-Version |
| 234 | - $xVersion = (string)$this->option('x-version'); |
|
| 234 | + $xVersion = (string) $this->option('x-version'); |
|
| 235 | 235 | if ($xVersion !== '') { |
| 236 | 236 | $_SERVER['X_VERSION'] = $_ENV['X_VERSION'] = $xVersion; |
| 237 | 237 | } |
@@ -258,34 +258,34 @@ discard block |
||
| 258 | 258 | public function publish() |
| 259 | 259 | { |
| 260 | 260 | $basePath = config('laravels.laravel_base_path') ?: base_path(); |
| 261 | - $configPath = $basePath . '/config/laravels.php'; |
|
| 261 | + $configPath = $basePath.'/config/laravels.php'; |
|
| 262 | 262 | $todoList = [ |
| 263 | 263 | [ |
| 264 | - 'from' => realpath(__DIR__ . '/../../config/laravels.php'), |
|
| 264 | + 'from' => realpath(__DIR__.'/../../config/laravels.php'), |
|
| 265 | 265 | 'to' => $configPath, |
| 266 | 266 | 'mode' => 0644, |
| 267 | 267 | ], |
| 268 | 268 | [ |
| 269 | - 'from' => realpath(__DIR__ . '/../../bin/laravels'), |
|
| 270 | - 'to' => $basePath . '/bin/laravels', |
|
| 269 | + 'from' => realpath(__DIR__.'/../../bin/laravels'), |
|
| 270 | + 'to' => $basePath.'/bin/laravels', |
|
| 271 | 271 | 'mode' => 0755, |
| 272 | 272 | 'link' => true, |
| 273 | 273 | ], |
| 274 | 274 | [ |
| 275 | - 'from' => realpath(__DIR__ . '/../../bin/fswatch'), |
|
| 276 | - 'to' => $basePath . '/bin/fswatch', |
|
| 275 | + 'from' => realpath(__DIR__.'/../../bin/fswatch'), |
|
| 276 | + 'to' => $basePath.'/bin/fswatch', |
|
| 277 | 277 | 'mode' => 0755, |
| 278 | 278 | 'link' => true, |
| 279 | 279 | ], |
| 280 | 280 | [ |
| 281 | - 'from' => realpath(__DIR__ . '/../../bin/inotify'), |
|
| 282 | - 'to' => $basePath . '/bin/inotify', |
|
| 281 | + 'from' => realpath(__DIR__.'/../../bin/inotify'), |
|
| 282 | + 'to' => $basePath.'/bin/inotify', |
|
| 283 | 283 | 'mode' => 0755, |
| 284 | 284 | 'link' => true, |
| 285 | 285 | ], |
| 286 | 286 | ]; |
| 287 | 287 | if (file_exists($configPath)) { |
| 288 | - $choice = $this->anticipate($configPath . ' already exists, do you want to override it ? Y/N', |
|
| 288 | + $choice = $this->anticipate($configPath.' already exists, do you want to override it ? Y/N', |
|
| 289 | 289 | ['Y', 'N'], |
| 290 | 290 | 'N' |
| 291 | 291 | ); |