@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | public function commands() |
11 | 11 | { |
12 | - return array_values(array_filter(Artisan::all(), function ($command) { |
|
12 | + return array_values(array_filter(Artisan::all(), function($command) { |
|
13 | 13 | return ! in_array($this->getNamespace($command), $this->ignoredNamespaces()); |
14 | 14 | })); |
15 | 15 | } |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | |
22 | 22 | public function namespaces() |
23 | 23 | { |
24 | - return array_values(array_unique(array_map(function ($command) { |
|
24 | + return array_values(array_unique(array_map(function($command) { |
|
25 | 25 | return $this->getNamespace($command); |
26 | 26 | }, $this->commands()))); |
27 | 27 | } |
28 | 28 | |
29 | 29 | public function getNamespace(Command $command) |
30 | 30 | { |
31 | - return explode(':', $command->getName())[0]; |
|
31 | + return explode(':', $command->getName())[ 0 ]; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function ignoredNamespaces() |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -Route::prefix(config('artisanui.api.prefix').'/'.config('artisanui.api.version'))->group(function () { |
|
4 | - Route::namespace('Desemax\\ArtisanUI\\Http\\Controllers\\API')->group(function () { |
|
3 | +Route::prefix(config('artisanui.api.prefix').'/'.config('artisanui.api.version'))->group(function() { |
|
4 | + Route::namespace('Desemax\\ArtisanUI\\Http\\Controllers\\API')->group(function() { |
|
5 | 5 | Route::get('commands', 'CommandsController@index'); |
6 | 6 | Route::post('commands/run', 'CommandsController@run'); |
7 | 7 | }); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'desemax'); |
18 | 18 | // $this->loadViewsFrom(__DIR__.'/../resources/views', 'desemax'); |
19 | 19 | // $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
20 | - $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
20 | + $this->loadRoutesFrom(__DIR__.'/routes.php'); |
|
21 | 21 | |
22 | 22 | // Publishing is only necessary when using the CLI. |
23 | 23 | if ($this->app->runningInConsole()) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $this->mergeConfigFrom(__DIR__.'/../config/artisanui.php', 'artisanui'); |
36 | 36 | |
37 | 37 | // Register the service the package provides. |
38 | - $this->app->singleton('artisanui', function ($app) { |
|
38 | + $this->app->singleton('artisanui', function($app) { |
|
39 | 39 | return new ArtisanUI; |
40 | 40 | }); |
41 | 41 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function provides() |
49 | 49 | { |
50 | - return ['artisanui']; |
|
50 | + return [ 'artisanui' ]; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | protected function getArguments() |
29 | 29 | { |
30 | - return array_map(function (InputArgument $inputArgument) { |
|
30 | + return array_map(function(InputArgument $inputArgument) { |
|
31 | 31 | return [ |
32 | 32 | 'name' => $inputArgument->getName(), |
33 | 33 | 'description' => $inputArgument->getDescription(), |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | protected function getOptions() |
41 | 41 | { |
42 | - return array_map(function (InputOption $inputOption) { |
|
42 | + return array_map(function(InputOption $inputOption) { |
|
43 | 43 | return [ |
44 | 44 | 'name' => $inputOption->getName(), |
45 | 45 | 'description' => $inputOption->getDescription(), |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | |
31 | 31 | protected function getArguments(Request $request) |
32 | 32 | { |
33 | - return array_merge($request->get('arguments', []), $this->getOptions($request)); |
|
33 | + return array_merge($request->get('arguments', [ ]), $this->getOptions($request)); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | protected function getOptions(Request $request) |
37 | 37 | { |
38 | - $result = []; |
|
39 | - foreach ($request->get('options', []) as $option) { |
|
40 | - $result['--'.$option] = true; |
|
38 | + $result = [ ]; |
|
39 | + foreach ($request->get('options', [ ]) as $option) { |
|
40 | + $result[ '--'.$option ] = true; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return $result; |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | try { |
51 | 51 | $status = ! empty($arguments) ? |
52 | - Artisan::call($request->get('name'), $arguments) : |
|
53 | - Artisan::call($request->get('name')); |
|
52 | + Artisan::call($request->get('name'), $arguments) : Artisan::call($request->get('name')); |
|
54 | 53 | } catch (\Exception $exception) { |
55 | 54 | return response()->json([ |
56 | 55 | 'status' => 1, |