@@ -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 | }); |
@@ -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 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Modules\User\Entities\User; |
4 | 4 | |
5 | -$factory->define(User::class, function (Faker\Generator $faker) { |
|
5 | +$factory->define(User::class, function(Faker\Generator $faker) { |
|
6 | 6 | return [ |
7 | 7 | 'auth0_id' => null, |
8 | 8 | 'name' => $faker->name, |
@@ -14,6 +14,6 @@ |
||
14 | 14 | |
15 | 15 | protected $collection = 'users'; |
16 | 16 | |
17 | - protected $guarded = []; |
|
17 | + protected $guarded = [ ]; |
|
18 | 18 | |
19 | 19 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | | This is used to verify the decoded tokens when using RS256 |
60 | 60 | | |
61 | 61 | */ |
62 | - 'authorized_issuers' => [env('AUTH0_DOMAIN')], |
|
62 | + 'authorized_issuers' => [ env('AUTH0_DOMAIN') ], |
|
63 | 63 | |
64 | 64 | /* |
65 | 65 | |-------------------------------------------------------------------------- |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | | Token decoding algorithms supported by your API |
86 | 86 | | |
87 | 87 | */ |
88 | - 'supported_algs' => ['RS256'], |
|
88 | + 'supported_algs' => [ 'RS256' ], |
|
89 | 89 | |
90 | 90 | /* |
91 | 91 | |-------------------------------------------------------------------------- |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function getUserByUserInfo($userInfo) |
44 | 44 | { |
45 | - return $this->upsertUser($userInfo['profile']); |
|
45 | + return $this->upsertUser($userInfo[ 'profile' ]); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | protected function upsertUser($profile) |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | throw new Exception('Missing token information: Auth0 user id is not set'); |
52 | 52 | } |
53 | 53 | $identifier = explode('|', $profile->user_id); |
54 | - $identityProvider = $identifier[0]; |
|
55 | - $id = $identifier[1]; |
|
54 | + $identityProvider = $identifier[ 0 ]; |
|
55 | + $id = $identifier[ 1 ]; |
|
56 | 56 | |
57 | 57 | $user = $this->service->find($id); |
58 | 58 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function find($id): ?User |
18 | 18 | { |
19 | - return Cache::remember($this->getCacheName($id), $this->getCacheTime(), function () use ($id) { |
|
19 | + return Cache::remember($this->getCacheName($id), $this->getCacheTime(), function() use ($id) { |
|
20 | 20 | return User::find($id); |
21 | 21 | }); |
22 | 22 | } |
@@ -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); |