@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | protected $service; |
| 17 | 17 | |
| 18 | - public function __construct(?string $name = null, array $data = [], string $dataName = '') |
|
| 18 | + public function __construct(?string $name = null, array $data = [ ], string $dataName = '') |
|
| 19 | 19 | { |
| 20 | 20 | parent::__construct($name, $data, $dataName); |
| 21 | 21 | $this->service = new BootstrapRegistrarService(); |
@@ -38,14 +38,14 @@ |
||
| 38 | 38 | $user = $this->auth0Repository->getUserByDecodedJWT($tokenInfo); |
| 39 | 39 | |
| 40 | 40 | if (!$user) { |
| 41 | - return response()->json(['error' => 'Unauthorized user.'], 401); |
|
| 41 | + return response()->json([ 'error' => 'Unauthorized user.' ], 401); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | \Auth::login($user); |
| 45 | 45 | } catch (InvalidTokenException $e) { |
| 46 | - return response()->json(['error' => 'Invalid or no token set.'], 401); |
|
| 46 | + return response()->json([ 'error' => 'Invalid or no token set.' ], 401); |
|
| 47 | 47 | } catch (CoreException $e) { |
| 48 | - return response()->json(['error' => $e->getMessage()], 401); |
|
| 48 | + return response()->json([ 'error' => $e->getMessage() ], 401); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | return $next($request); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | private function getUserTokenData(): \stdClass |
| 29 | 29 | { |
| 30 | - return Cache::remember('testing:http_access_token', 60, function () { |
|
| 30 | + return Cache::remember('testing:http_access_token', 60, function() { |
|
| 31 | 31 | $httpClient = new Client(); |
| 32 | 32 | $response = $httpClient->post(config('laravel-auth0.domain').'oauth/token', [ |
| 33 | 33 | 'form_params' => [ |
@@ -43,19 +43,19 @@ discard block |
||
| 43 | 43 | }); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - protected function http(string $method, string $route, array $payload = []) |
|
| 46 | + protected function http(string $method, string $route, array $payload = [ ]) |
|
| 47 | 47 | { |
| 48 | 48 | return $this->sendRequest($method, $route, $payload, true); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
| 51 | + private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
| 52 | 52 | { |
| 53 | 53 | return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
| 54 | 54 | 'Authorization' => 'Bearer '.$this->getUserTokenData()->id_token, |
| 55 | - ] : []); |
|
| 55 | + ] : [ ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - protected function httpNoAuth(string $method, string $route, array $payload = []) |
|
| 58 | + protected function httpNoAuth(string $method, string $route, array $payload = [ ]) |
|
| 59 | 59 | { |
| 60 | 60 | return $this->sendRequest($method, $route, $payload, false); |
| 61 | 61 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $this->artisan('migrate:fresh'); |
| 24 | 24 | $this->artisan('db:seed'); |
| 25 | 25 | |
| 26 | - $this->beforeApplicationDestroyed(function () { |
|
| 26 | + $this->beforeApplicationDestroyed(function() { |
|
| 27 | 27 | $this->artisan('migrate:rollback'); |
| 28 | 28 | RefreshDatabaseState::$migrated = false; |
| 29 | 29 | }); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function created($model) |
| 21 | 21 | { |
| 22 | - $model->relations = []; |
|
| 22 | + $model->relations = [ ]; |
|
| 23 | 23 | ModelCache::store($model); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | /** |
| 37 | 37 | * @var array |
| 38 | 38 | */ |
| 39 | - protected $guarded = []; |
|
| 39 | + protected $guarded = [ ]; |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * @return mixed |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | 'supportsCredentials' => false, |
| 16 | - 'allowedOrigins' => ['*'], |
|
| 17 | - 'allowedOriginsPatterns' => [], |
|
| 18 | - 'allowedHeaders' => ['*'], |
|
| 19 | - 'allowedMethods' => ['*'], |
|
| 20 | - 'exposedHeaders' => [], |
|
| 16 | + 'allowedOrigins' => [ '*' ], |
|
| 17 | + 'allowedOriginsPatterns' => [ ], |
|
| 18 | + 'allowedHeaders' => [ '*' ], |
|
| 19 | + 'allowedMethods' => [ '*' ], |
|
| 20 | + 'exposedHeaders' => [ ], |
|
| 21 | 21 | 'maxAge' => 0, |
| 22 | 22 | |
| 23 | 23 | ]; |
@@ -63,16 +63,16 @@ discard block |
||
| 63 | 63 | private function loadRoutes() |
| 64 | 64 | { |
| 65 | 65 | foreach ($this->bootstrapService->getRoutes() as $route) { |
| 66 | - $path = $route['path']; |
|
| 66 | + $path = $route[ 'path' ]; |
|
| 67 | 67 | Route::group([ |
| 68 | - 'prefix' => 'v1/'.$route['module'], |
|
| 69 | - 'namespace' => $route['controller'], |
|
| 70 | - 'domain' => $route['domain'], |
|
| 71 | - 'middleware' => ['api'], |
|
| 72 | - ], function () use ($path) { |
|
| 68 | + 'prefix' => 'v1/'.$route[ 'module' ], |
|
| 69 | + 'namespace' => $route[ 'controller' ], |
|
| 70 | + 'domain' => $route[ 'domain' ], |
|
| 71 | + 'middleware' => [ 'api' ], |
|
| 72 | + ], function() use ($path) { |
|
| 73 | 73 | require $path; |
| 74 | 74 | }); |
| 75 | - Route::model($route['module'], $route['model']); |
|
| 75 | + Route::model($route[ 'module' ], $route[ 'model' ]); |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | foreach ($this->bootstrapService->getConfigs() as $config) { |
| 87 | 87 | $this->publishes([ |
| 88 | - $config['path'] => config_path($config['module']), |
|
| 88 | + $config[ 'path' ] => config_path($config[ 'module' ]), |
|
| 89 | 89 | ], 'config'); |
| 90 | 90 | $this->mergeConfigFrom( |
| 91 | - $config['path'], basename($config['module'], '.php') |
|
| 91 | + $config[ 'path' ], basename($config[ 'module' ], '.php') |
|
| 92 | 92 | ); |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | foreach ($this->bootstrapService->getFactories() as $factory) { |
| 104 | 104 | if (!$this->app->environment('production')) { |
| 105 | - app(Factory::class)->load($factory['path']); |
|
| 105 | + app(Factory::class)->load($factory[ 'path' ]); |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -115,15 +115,15 @@ discard block |
||
| 115 | 115 | public function loadMigrations() |
| 116 | 116 | { |
| 117 | 117 | foreach ($this->bootstrapService->getMigrations() as $migration) { |
| 118 | - $this->loadMigrationsFrom($migration['path']); |
|
| 118 | + $this->loadMigrationsFrom($migration[ 'path' ]); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | private function loadPolicies() |
| 123 | 123 | { |
| 124 | 124 | foreach ($this->bootstrapService->getPolicies() as $policy) { |
| 125 | - if (classImplementsInterface($policy['class'], ModelPolicyContract::class)) { |
|
| 126 | - Gate::policy($policy['model'], $policy['class']); |
|
| 125 | + if (classImplementsInterface($policy[ 'class' ], ModelPolicyContract::class)) { |
|
| 126 | + Gate::policy($policy[ 'model' ], $policy[ 'class' ]); |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | } |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $app = $this->app; |
| 134 | 134 | $service = $this->bootstrapService; |
| 135 | - $this->app->extend('command.seed', function () use ($app, $service) { |
|
| 136 | - return new SeedCommand($app['db'], $service); |
|
| 135 | + $this->app->extend('command.seed', function() use ($app, $service) { |
|
| 136 | + return new SeedCommand($app[ 'db' ], $service); |
|
| 137 | 137 | }); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -11,6 +11,6 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Broadcast::channel('App.User.{id}', function ($user, $id) { |
|
| 14 | +Broadcast::channel('App.User.{id}', function($user, $id) { |
|
| 15 | 15 | return (int) $user->id === (int) $id; |
| 16 | 16 | }); |