@@ -141,6 +141,6 @@ |
||
| 141 | 141 | | |
| 142 | 142 | */ |
| 143 | 143 | |
| 144 | - 'attributes' => [], |
|
| 144 | + 'attributes' => [ ], |
|
| 145 | 145 | |
| 146 | 146 | ]; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | protected $commands = [ |
| 18 | 18 | BootstrapCacheCommand::class, |
| 19 | - // SeedCommand::class |
|
| 19 | + // SeedCommand::class |
|
| 20 | 20 | ]; |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::get('/blabla', function (Request $request) { |
|
| 16 | +Route::get('/blabla', function(Request $request) { |
|
| 17 | 17 | return response()->json('welcome to blabla the api'); |
| 18 | 18 | }); |
| 19 | 19 | |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::get('/test', function (Request $request) { |
|
| 16 | +Route::get('/test', function(Request $request) { |
|
| 17 | 17 | return response()->json('welcome to the api'); |
| 18 | 18 | }); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | public function getUserByUserInfo($userInfo) |
| 41 | 41 | { |
| 42 | - return $this->upsertUser($userInfo['profile']); |
|
| 42 | + return $this->upsertUser($userInfo[ 'profile' ]); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | protected function upsertUser($profile) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function buildBootstrapArray() |
| 42 | 42 | { |
| 43 | - $bootstrap = []; |
|
| 43 | + $bootstrap = [ ]; |
|
| 44 | 44 | foreach (\Module::all() as $module) { |
| 45 | 45 | foreach ($this->moduleEntityDirectories as $key => $directory) { |
| 46 | 46 | $directory = ucfirst($directory); |
@@ -57,26 +57,26 @@ discard block |
||
| 57 | 57 | try { |
| 58 | 58 | $command = new $class(); |
| 59 | 59 | if ($command instanceof Command) { |
| 60 | - $bootstrap[$key][] = $class; |
|
| 60 | + $bootstrap[ $key ][ ] = $class; |
|
| 61 | 61 | } |
| 62 | 62 | } catch (\Exception $e) { |
| 63 | 63 | //If the creation of the class fails it is not a command so skip |
| 64 | 64 | } |
| 65 | 65 | break; |
| 66 | 66 | case 'routes': |
| 67 | - $bootstrap[$key][] = [$directoryPath.'/'.$fileName, $namespace]; |
|
| 67 | + $bootstrap[ $key ][ ] = [ $directoryPath.'/'.$fileName, $namespace ]; |
|
| 68 | 68 | break; |
| 69 | 69 | case 'configs': |
| 70 | - $bootstrap[$key][] = [$directoryPath.'/'.$fileName, strtolower($module->getName())]; |
|
| 70 | + $bootstrap[ $key ][ ] = [ $directoryPath.'/'.$fileName, strtolower($module->getName()) ]; |
|
| 71 | 71 | break; |
| 72 | 72 | case 'factories': |
| 73 | - $bootstrap[$key][] = $directoryPath; |
|
| 73 | + $bootstrap[ $key ][ ] = $directoryPath; |
|
| 74 | 74 | break; |
| 75 | 75 | case 'migrations': |
| 76 | - $bootstrap[$key][] = $directoryPath; |
|
| 76 | + $bootstrap[ $key ][ ] = $directoryPath; |
|
| 77 | 77 | break; |
| 78 | 78 | case 'seeders': |
| 79 | - $bootstrap[$key][] = $class; |
|
| 79 | + $bootstrap[ $key ][ ] = $class; |
|
| 80 | 80 | break; |
| 81 | 81 | default: |
| 82 | 82 | break; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | private function hasPhpExtension(string $fileName): bool |
| 94 | 94 | { |
| 95 | - return strlen($fileName) > 4 && '.php' === ($fileName[-4].$fileName[-3].$fileName[-2].$fileName[-1]); |
|
| 95 | + return strlen($fileName) > 4 && '.php' === ($fileName[-4 ].$fileName[-3 ].$fileName[-2 ].$fileName[-1 ]); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | private function loadBootstrapFromCache() |
@@ -110,32 +110,32 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | public function getCommands(): array |
| 112 | 112 | { |
| 113 | - return $this->loadBootstrapFromCache()['commands'] ?? []; |
|
| 113 | + return $this->loadBootstrapFromCache()[ 'commands' ] ?? [ ]; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | public function getRoutes(): array |
| 117 | 117 | { |
| 118 | - return $this->loadBootstrapFromCache()['routes'] ?? []; |
|
| 118 | + return $this->loadBootstrapFromCache()[ 'routes' ] ?? [ ]; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | public function getConfigs(): array |
| 122 | 122 | { |
| 123 | - return $this->loadBootstrapFromCache()['configs'] ?? []; |
|
| 123 | + return $this->loadBootstrapFromCache()[ 'configs' ] ?? [ ]; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | public function getFactories(): array |
| 127 | 127 | { |
| 128 | - return $this->loadBootstrapFromCache()['factories'] ?? []; |
|
| 128 | + return $this->loadBootstrapFromCache()[ 'factories' ] ?? [ ]; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | public function getMigrations(): array |
| 132 | 132 | { |
| 133 | - return $this->loadBootstrapFromCache()['migrations'] ?? []; |
|
| 133 | + return $this->loadBootstrapFromCache()[ 'migrations' ] ?? [ ]; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | public function getSeeders(): array |
| 137 | 137 | { |
| 138 | - return $this->loadBootstrapFromCache()['seeders'] ?? []; |
|
| 138 | + return $this->loadBootstrapFromCache()[ 'seeders' ] ?? [ ]; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | public function getCachePath(): string |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | $apiDomain = strtolower(env('API_URL')); |
| 53 | 53 | $apiDomain = str_replace('http://', '', $apiDomain); |
| 54 | 54 | $apiDomain = str_replace('https://', '', $apiDomain); |
| 55 | - $namespace = $route[1].'\\'.'Http\\Controllers'; |
|
| 56 | - $filepath = $route[0]; |
|
| 55 | + $namespace = $route[ 1 ].'\\'.'Http\\Controllers'; |
|
| 56 | + $filepath = $route[ 0 ]; |
|
| 57 | 57 | Route::group([ |
| 58 | 58 | 'prefix' => 'v1', |
| 59 | 59 | 'namespace' => $namespace, |
| 60 | 60 | 'domain' => $apiDomain, |
| 61 | - 'middleware' => [], |
|
| 62 | - ], function (Router $router) use ($filepath) { |
|
| 61 | + 'middleware' => [ ], |
|
| 62 | + ], function(Router $router) use ($filepath) { |
|
| 63 | 63 | require $filepath; |
| 64 | 64 | }); |
| 65 | 65 | } |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | foreach ($this->bootstrapService->getConfigs() as $route) { |
| 76 | 76 | $this->publishes([ |
| 77 | - $route[0] => config_path($route[1]), |
|
| 77 | + $route[ 0 ] => config_path($route[ 1 ]), |
|
| 78 | 78 | ], 'config'); |
| 79 | 79 | $this->mergeConfigFrom( |
| 80 | - $route[0], basename($route[1], '.php') |
|
| 80 | + $route[ 0 ], basename($route[ 1 ], '.php') |
|
| 81 | 81 | ); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $app = $this->app; |
| 119 | 119 | $service = $this->bootstrapService; |
| 120 | - $this->app->extend('command.seed', function () use ($app, $service) { |
|
| 121 | - return new SeedCommand($app['db'], $service); |
|
| 120 | + $this->app->extend('command.seed', function() use ($app, $service) { |
|
| 121 | + return new SeedCommand($app[ 'db' ], $service); |
|
| 122 | 122 | }); |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $this->resolver->setDefaultConnection($this->getDatabase()); |
| 36 | 36 | |
| 37 | - Model::unguarded(function () { |
|
| 37 | + Model::unguarded(function() { |
|
| 38 | 38 | foreach ($this->getSeeders() as $seeder) { |
| 39 | 39 | $seeder = $this->laravel->make($seeder); |
| 40 | 40 | $seeder->__invoke(); |
@@ -48,6 +48,6 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $this->service = $this->laravel->make(BootstrapRegistrarService::class); |
| 50 | 50 | |
| 51 | - return $this->service->getSeeders() ?? []; |
|
| 51 | + return $this->service->getSeeders() ?? [ ]; |
|
| 52 | 52 | } |
| 53 | 53 | } |
@@ -37,14 +37,14 @@ |
||
| 37 | 37 | $tokenInfo = $auth0->decodeJWT($accessToken); |
| 38 | 38 | $user = $this->auth0Repository->getUserByDecodedJWT($tokenInfo); |
| 39 | 39 | if (!$user) { |
| 40 | - return response()->json(['message' => 'Unauthorized user'], 401); |
|
| 40 | + return response()->json([ 'message' => 'Unauthorized user' ], 401); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | \Auth::login($user); |
| 44 | 44 | } catch (InvalidTokenException $e) { |
| 45 | - return response()->json(['message' => $e->getMessage()], 401); |
|
| 45 | + return response()->json([ 'message' => $e->getMessage() ], 401); |
|
| 46 | 46 | } catch (CoreException $e) { |
| 47 | - return response()->json(['message' => $e->getMessage()], 401); |
|
| 47 | + return response()->json([ 'message' => $e->getMessage() ], 401); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return $next($request); |