@@ -7,27 +7,27 @@ |
||
7 | 7 | |
8 | 8 | class Inspire extends Command |
9 | 9 | { |
10 | - /** |
|
11 | - * The name and signature of the console command. |
|
12 | - * |
|
13 | - * @var string |
|
14 | - */ |
|
15 | - protected $signature = 'inspire'; |
|
10 | + /** |
|
11 | + * The name and signature of the console command. |
|
12 | + * |
|
13 | + * @var string |
|
14 | + */ |
|
15 | + protected $signature = 'inspire'; |
|
16 | 16 | |
17 | - /** |
|
18 | - * The console command description. |
|
19 | - * |
|
20 | - * @var string |
|
21 | - */ |
|
22 | - protected $description = 'Display an inspiring quote'; |
|
17 | + /** |
|
18 | + * The console command description. |
|
19 | + * |
|
20 | + * @var string |
|
21 | + */ |
|
22 | + protected $description = 'Display an inspiring quote'; |
|
23 | 23 | |
24 | - /** |
|
25 | - * Execute the console command. |
|
26 | - * |
|
27 | - * @return mixed |
|
28 | - */ |
|
29 | - public function handle() |
|
30 | - { |
|
31 | - $this->comment(PHP_EOL.Inspiring::quote().PHP_EOL); |
|
32 | - } |
|
24 | + /** |
|
25 | + * Execute the console command. |
|
26 | + * |
|
27 | + * @return mixed |
|
28 | + */ |
|
29 | + public function handle() |
|
30 | + { |
|
31 | + $this->comment(PHP_EOL.Inspiring::quote().PHP_EOL); |
|
32 | + } |
|
33 | 33 | } |
@@ -283,7 +283,6 @@ |
||
283 | 283 | |
284 | 284 | /** |
285 | 285 | * validateDBInfo |
286 | - |
|
287 | 286 | * @param $dbInfo |
288 | 287 | * |
289 | 288 | * @return bool |
@@ -490,8 +490,8 @@ discard block |
||
490 | 490 | /** |
491 | 491 | * setEnv |
492 | 492 | * |
493 | - * @param $key |
|
494 | - * @param $newValue |
|
493 | + * @param string $key |
|
494 | + * @param string $newValue |
|
495 | 495 | * @param string $defaultValue |
496 | 496 | * |
497 | 497 | * @return void |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | /** |
606 | 606 | * basePath |
607 | 607 | * |
608 | - * @param null $path |
|
608 | + * @param string $path |
|
609 | 609 | * |
610 | 610 | * @return string |
611 | 611 | */ |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | } catch (\Exception $e) { |
134 | 134 | $err = [ |
135 | 135 | 'System error', |
136 | - ' message: ' . $e->getMessage(), |
|
137 | - ' file: ' . $e->getFile(), |
|
138 | - ' line: ' . $e->getLine(), |
|
136 | + ' message: '.$e->getMessage(), |
|
137 | + ' file: '.$e->getFile(), |
|
138 | + ' line: '.$e->getLine(), |
|
139 | 139 | ]; |
140 | 140 | $this->output->error(implode(PHP_EOL, $err)); |
141 | 141 | $note = [ |
@@ -291,13 +291,13 @@ discard block |
||
291 | 291 | try { |
292 | 292 | $this->setStorageDirPermission(); |
293 | 293 | } catch (\Exception $e) { |
294 | - $this->error('Fail to change storage directory permission. Check directory after install.' . PHP_EOL . ' message: '. $e->getMessage()); |
|
294 | + $this->error('Fail to change storage directory permission. Check directory after install.'.PHP_EOL.' message: '.$e->getMessage()); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | try { |
298 | 298 | $this->setBootCacheDirPermission(); |
299 | 299 | } catch (\Exception $e) { |
300 | - $this->error('Fail to change bootstrap cache directory permission. Check directory after install.' . PHP_EOL . ' message: '. $e->getMessage()); |
|
300 | + $this->error('Fail to change bootstrap cache directory permission. Check directory after install.'.PHP_EOL.' message: '.$e->getMessage()); |
|
301 | 301 | } |
302 | 302 | } |
303 | 303 | |
@@ -423,13 +423,13 @@ discard block |
||
423 | 423 | */ |
424 | 424 | private function configFileGenerate($key, array $data) |
425 | 425 | { |
426 | - $dir = config_path() . '/cms'; |
|
426 | + $dir = config_path().'/cms'; |
|
427 | 427 | $this->makeDir($dir); |
428 | 428 | |
429 | 429 | $data = $this->encodeArr2Str($data); |
430 | 430 | |
431 | - $file = $dir . "/{$key}.php"; |
|
432 | - file_put_contents($file, '<?php' . str_repeat(PHP_EOL, 2) . 'return [' . PHP_EOL . $data . '];' . PHP_EOL); |
|
431 | + $file = $dir."/{$key}.php"; |
|
432 | + file_put_contents($file, '<?php'.str_repeat(PHP_EOL, 2).'return ['.PHP_EOL.$data.'];'.PHP_EOL); |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
@@ -462,9 +462,9 @@ discard block |
||
462 | 462 | |
463 | 463 | foreach ($arr as $key => $val) { |
464 | 464 | if (is_array($val)) { |
465 | - $output .= $this->getIndent($depth) . "'{$key}' => " . '[' . PHP_EOL . $this->encodeArr2Str($val, $depth + 1) . $this->getIndent($depth) . '],' . PHP_EOL; |
|
465 | + $output .= $this->getIndent($depth)."'{$key}' => ".'['.PHP_EOL.$this->encodeArr2Str($val, $depth + 1).$this->getIndent($depth).'],'.PHP_EOL; |
|
466 | 466 | } else { |
467 | - $output .= $this->getIndent($depth) . "'{$key}' => " . (is_int($val) ? $val : "'{$val}'") .',' . PHP_EOL; |
|
467 | + $output .= $this->getIndent($depth)."'{$key}' => ".(is_int($val) ? $val : "'{$val}'").','.PHP_EOL; |
|
468 | 468 | } |
469 | 469 | } |
470 | 470 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $siteInfo = $this->defaultInfos['site']; |
519 | 519 | |
520 | 520 | // site url |
521 | - $siteInfo['url'] = $this->askValidation('site url', $siteInfo['url'], function ($url) { |
|
521 | + $siteInfo['url'] = $this->askValidation('site url', $siteInfo['url'], function($url) { |
|
522 | 522 | $url = trim($url, "/"); |
523 | 523 | if (filter_var($url, FILTER_VALIDATE_URL) === false) { |
524 | 524 | throw new \Exception('Invalid URL Format.'); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | }); |
528 | 528 | |
529 | 529 | // timezone |
530 | - $siteInfo['timezone'] = $this->askValidation('Timezone', $siteInfo['timezone'], function ($timezone) { |
|
530 | + $siteInfo['timezone'] = $this->askValidation('Timezone', $siteInfo['timezone'], function($timezone) { |
|
531 | 531 | if (in_array($timezone, timezone_identifiers_list()) === false) { |
532 | 532 | throw new \Exception('Inputted timezone do not exist.'); |
533 | 533 | } |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | $process = new Process(implode(' && ', $commands), $this->getBasePath(), null, null, null); |
699 | 699 | |
700 | 700 | $process->run( |
701 | - function ($type, $line) { |
|
701 | + function($type, $line) { |
|
702 | 702 | $this->line($line); |
703 | 703 | } |
704 | 704 | ); |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | $adminInfo = $this->defaultInfos['admin']; |
744 | 744 | |
745 | 745 | |
746 | - $adminInfo['email'] = $this->askValidation('Email', $adminInfo['email'], function ($email) { |
|
746 | + $adminInfo['email'] = $this->askValidation('Email', $adminInfo['email'], function($email) { |
|
747 | 747 | $validate = \Validator::make( |
748 | 748 | ['email' => $email], |
749 | 749 | [ |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | }); |
758 | 758 | |
759 | 759 | // displayName |
760 | - $adminInfo['displayName'] = $this->askValidation('Name', $adminInfo['displayName'], function ($displayName) { |
|
760 | + $adminInfo['displayName'] = $this->askValidation('Name', $adminInfo['displayName'], function($displayName) { |
|
761 | 761 | if (strlen(trim($displayName)) === 0) { |
762 | 762 | throw new \Exception('Input Name'); |
763 | 763 | } |
@@ -2,5 +2,5 @@ |
||
2 | 2 | |
3 | 3 | abstract class Event |
4 | 4 | { |
5 | - // |
|
5 | + // |
|
6 | 6 | } |
@@ -9,5 +9,5 @@ |
||
9 | 9 | |
10 | 10 | abstract class Controller extends BaseController |
11 | 11 | { |
12 | - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
|
12 | + use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
|
13 | 13 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | if (strstr($type, '/')) { |
16 | 16 | $pos = strrpos($type, '/'); |
17 | - $instanceId = substr($type, $pos+1); |
|
17 | + $instanceId = substr($type, $pos + 1); |
|
18 | 18 | $type = substr($type, 0, $pos); |
19 | 19 | } else { |
20 | 20 | $instanceId = null; |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | class WelcomeController extends Controller { |
4 | 4 | |
5 | - /* |
|
5 | + /* |
|
6 | 6 | |-------------------------------------------------------------------------- |
7 | 7 | | Welcome Controller |
8 | 8 | |-------------------------------------------------------------------------- |
@@ -13,24 +13,24 @@ discard block |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | - /** |
|
17 | - * Create a new controller instance. |
|
18 | - * |
|
19 | - * @return void |
|
20 | - */ |
|
21 | - public function __construct() |
|
22 | - { |
|
23 | - $this->middleware('guest'); |
|
24 | - } |
|
16 | + /** |
|
17 | + * Create a new controller instance. |
|
18 | + * |
|
19 | + * @return void |
|
20 | + */ |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | + $this->middleware('guest'); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Show the application welcome screen to the user. |
|
28 | - * |
|
29 | - * @return Response |
|
30 | - */ |
|
31 | - public function index() |
|
32 | - { |
|
33 | - return view('welcome'); |
|
34 | - } |
|
26 | + /** |
|
27 | + * Show the application welcome screen to the user. |
|
28 | + * |
|
29 | + * @return Response |
|
30 | + */ |
|
31 | + public function index() |
|
32 | + { |
|
33 | + return view('welcome'); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | } |
@@ -7,41 +7,41 @@ |
||
7 | 7 | |
8 | 8 | class Authenticate |
9 | 9 | { |
10 | - /** |
|
11 | - * The Guard implementation. |
|
12 | - * |
|
13 | - * @var Guard |
|
14 | - */ |
|
15 | - protected $auth; |
|
10 | + /** |
|
11 | + * The Guard implementation. |
|
12 | + * |
|
13 | + * @var Guard |
|
14 | + */ |
|
15 | + protected $auth; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Create a new filter instance. |
|
19 | - * |
|
20 | - * @param Guard $auth |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function __construct(Guard $auth) |
|
24 | - { |
|
25 | - $this->auth = $auth; |
|
26 | - } |
|
17 | + /** |
|
18 | + * Create a new filter instance. |
|
19 | + * |
|
20 | + * @param Guard $auth |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function __construct(Guard $auth) |
|
24 | + { |
|
25 | + $this->auth = $auth; |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Handle an incoming request. |
|
30 | - * |
|
31 | - * @param \Illuminate\Http\Request $request |
|
32 | - * @param \Closure $next |
|
33 | - * @return mixed |
|
34 | - */ |
|
35 | - public function handle($request, Closure $next) |
|
36 | - { |
|
37 | - if ($this->auth->guest()) { |
|
38 | - if ($request->ajax()) { |
|
39 | - return response('Unauthorized.', 401); |
|
40 | - } else { |
|
41 | - return redirect()->guest('auth/login'); |
|
42 | - } |
|
43 | - } |
|
28 | + /** |
|
29 | + * Handle an incoming request. |
|
30 | + * |
|
31 | + * @param \Illuminate\Http\Request $request |
|
32 | + * @param \Closure $next |
|
33 | + * @return mixed |
|
34 | + */ |
|
35 | + public function handle($request, Closure $next) |
|
36 | + { |
|
37 | + if ($this->auth->guest()) { |
|
38 | + if ($request->ajax()) { |
|
39 | + return response('Unauthorized.', 401); |
|
40 | + } else { |
|
41 | + return redirect()->guest('auth/login'); |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | - return $next($request); |
|
46 | - } |
|
45 | + return $next($request); |
|
46 | + } |
|
47 | 47 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | protected function execute($input) |
27 | 27 | { |
28 | 28 | if (is_array($input) === true) { |
29 | - return array_map(function ($item) { |
|
29 | + return array_map(function($item) { |
|
30 | 30 | return $this->execute($item); |
31 | 31 | }, $input); |
32 | 32 | } |
@@ -7,37 +7,37 @@ |
||
7 | 7 | |
8 | 8 | class RedirectIfAuthenticated |
9 | 9 | { |
10 | - /** |
|
11 | - * The Guard implementation. |
|
12 | - * |
|
13 | - * @var Guard |
|
14 | - */ |
|
15 | - protected $auth; |
|
10 | + /** |
|
11 | + * The Guard implementation. |
|
12 | + * |
|
13 | + * @var Guard |
|
14 | + */ |
|
15 | + protected $auth; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Create a new filter instance. |
|
19 | - * |
|
20 | - * @param Guard $auth |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function __construct(Guard $auth) |
|
24 | - { |
|
25 | - $this->auth = $auth; |
|
26 | - } |
|
17 | + /** |
|
18 | + * Create a new filter instance. |
|
19 | + * |
|
20 | + * @param Guard $auth |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function __construct(Guard $auth) |
|
24 | + { |
|
25 | + $this->auth = $auth; |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Handle an incoming request. |
|
30 | - * |
|
31 | - * @param \Illuminate\Http\Request $request |
|
32 | - * @param \Closure $next |
|
33 | - * @return mixed |
|
34 | - */ |
|
35 | - public function handle($request, Closure $next) |
|
36 | - { |
|
37 | - if ($this->auth->check()) { |
|
38 | - return redirect('/'); |
|
39 | - } |
|
28 | + /** |
|
29 | + * Handle an incoming request. |
|
30 | + * |
|
31 | + * @param \Illuminate\Http\Request $request |
|
32 | + * @param \Closure $next |
|
33 | + * @return mixed |
|
34 | + */ |
|
35 | + public function handle($request, Closure $next) |
|
36 | + { |
|
37 | + if ($this->auth->check()) { |
|
38 | + return redirect('/'); |
|
39 | + } |
|
40 | 40 | |
41 | - return $next($request); |
|
42 | - } |
|
41 | + return $next($request); |
|
42 | + } |
|
43 | 43 | } |