@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('users', function (Blueprint $table) { |
|
15 | + Schema::create('users', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('identity_id')->unique(); |
18 | 18 | $table->string('email'); |
@@ -31,11 +31,11 @@ |
||
31 | 31 | */ |
32 | 32 | public function boot() |
33 | 33 | { |
34 | - $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function () { |
|
34 | + $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function() { |
|
35 | 35 | return new Auth0Service(new UserService()); |
36 | 36 | }); |
37 | 37 | |
38 | - $this->app->bind(Auth0ServiceContract::class, function () { |
|
38 | + $this->app->bind(Auth0ServiceContract::class, function() { |
|
39 | 39 | return new Auth0Service(new UserService()); |
40 | 40 | }); |
41 | 41 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function getUserByUserInfo($userInfo) |
51 | 51 | { |
52 | - return $this->upsertUser($userInfo['profile']); |
|
52 | + return $this->upsertUser($userInfo[ 'profile' ]); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | protected function upsertUser($profile) |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | throw new BadRequestHttpException('Missing token information: Auth0 user id is not set'); |
59 | 59 | } |
60 | 60 | $identifier = explode('|', $profile->user_id); |
61 | - $identityProvider = $identifier[0]; |
|
62 | - $id = $identifier[1]; |
|
61 | + $identityProvider = $identifier[ 0 ]; |
|
62 | + $id = $identifier[ 1 ]; |
|
63 | 63 | |
64 | 64 | $user = $this->service->findByIdentityId($id); |
65 | 65 | if ($user === null) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | public function getTestUserToken() |
97 | 97 | { |
98 | - return Cache::remember('testing:http_access_token', 60, function () { |
|
98 | + return Cache::remember('testing:http_access_token', 60, function() { |
|
99 | 99 | try { |
100 | 100 | $httpClient = new Client(); |
101 | 101 | $response = $httpClient->post(env('AUTH0_DOMAIN').'oauth/token', [ |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | public function handle() |
20 | 20 | { |
21 | - Model::unguarded(function () { |
|
21 | + Model::unguarded(function() { |
|
22 | 22 | $seeder = app()->make(DemoSeeder::class); |
23 | 23 | $seeder->__invoke(); |
24 | 24 | }); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | public function setRoles($id, array $roles): void |
71 | 71 | { |
72 | 72 | if (!in_array(Role::USER, $roles)) |
73 | - $roles[] = Role::USER; |
|
73 | + $roles[ ] = Role::USER; |
|
74 | 74 | $this->find($id)->syncRoles($roles); |
75 | 75 | } |
76 | 76 | } |
@@ -22,5 +22,5 @@ |
||
22 | 22 | |
23 | 23 | public function delete($id): bool; |
24 | 24 | |
25 | - public function heartbeat($id,$data): void; |
|
25 | + public function heartbeat($id, $data): void; |
|
26 | 26 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | class MachineUpdatedEvent extends Event implements ShouldBroadcast |
18 | 18 | { |
19 | - public $listeners = []; |
|
19 | + public $listeners = [ ]; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @var Machine |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function broadcastOn() |
37 | 37 | { |
38 | - return new PrivateChannel('user.' . $this->machine->user_id); |
|
38 | + return new PrivateChannel('user.'.$this->machine->user_id); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function broadcastAs() |
@@ -11,6 +11,6 @@ |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | -Broadcast::channel('user.{id}', function ($user, $id) { |
|
14 | +Broadcast::channel('user.{id}', function($user, $id) { |
|
15 | 15 | return $user->id === (int) $id; |
16 | 16 | }); |
@@ -56,32 +56,32 @@ |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | if ($unwrap) { |
59 | - return json_decode($content, true)['data'] ?? json_decode($content, true); |
|
59 | + return json_decode($content, true)[ 'data' ] ?? json_decode($content, true); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | return json_decode($content, true); |
63 | 63 | } |
64 | 64 | |
65 | - protected function http(string $method, string $route, array $payload = []) |
|
65 | + protected function http(string $method, string $route, array $payload = [ ]) |
|
66 | 66 | { |
67 | 67 | return $this->sendRequest($method, $route, $payload, true); |
68 | 68 | } |
69 | 69 | |
70 | - private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
70 | + private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
71 | 71 | { |
72 | - return $this->json($method, env('API_URL') . '/' . $route, $payload, $authenticated ? [ |
|
73 | - 'Authorization' => 'Bearer ' . $this->getAuth0Service()->getTestUserToken()->id_token, |
|
74 | - ] : []); |
|
72 | + return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
|
73 | + 'Authorization' => 'Bearer '.$this->getAuth0Service()->getTestUserToken()->id_token, |
|
74 | + ] : [ ]); |
|
75 | 75 | } |
76 | 76 | |
77 | - protected function sendRequestWithToken($token, string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
77 | + protected function sendRequestWithToken($token, string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
78 | 78 | { |
79 | - return $this->json($method, env('API_URL') . '/' . $route, $payload, $authenticated ? [ |
|
80 | - 'Authorization' => 'Bearer ' . $token, |
|
81 | - ] : []); |
|
79 | + return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
|
80 | + 'Authorization' => 'Bearer '.$token, |
|
81 | + ] : [ ]); |
|
82 | 82 | } |
83 | 83 | |
84 | - protected function httpNoAuth(string $method, string $route, array $payload = []) |
|
84 | + protected function httpNoAuth(string $method, string $route, array $payload = [ ]) |
|
85 | 85 | { |
86 | 86 | return $this->sendRequest($method, $route, $payload, false); |
87 | 87 | } |