@@ -71,7 +71,7 @@ |
||
71 | 71 | public function setRoles($id, array $roles): void |
72 | 72 | { |
73 | 73 | if (!in_array(Role::USER, $roles)) { |
74 | - $roles[] = Role::USER; |
|
74 | + $roles[ ] = Role::USER; |
|
75 | 75 | } |
76 | 76 | $this->find($id)->syncRoles($roles); |
77 | 77 | } |
@@ -16,7 +16,7 @@ |
||
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 |
@@ -56,8 +56,8 @@ |
||
56 | 56 | { |
57 | 57 | $this->update($id, [ |
58 | 58 | 'last_heartbeat' => Carbon::now(), |
59 | - 'memory_usage' => $data['memory_usage'], |
|
60 | - 'cpu_usage' => $data['cpu_usage'], |
|
59 | + 'memory_usage' => $data[ 'memory_usage' ], |
|
60 | + 'cpu_usage' => $data[ 'cpu_usage' ], |
|
61 | 61 | 'online' => true, |
62 | 62 | ]); |
63 | 63 | } |
@@ -58,32 +58,32 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($unwrap) { |
61 | - return json_decode($content, true)['data'] ?? json_decode($content, true); |
|
61 | + return json_decode($content, true)[ 'data' ] ?? json_decode($content, true); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | return json_decode($content, true); |
65 | 65 | } |
66 | 66 | |
67 | - protected function http(string $method, string $route, array $payload = []) |
|
67 | + protected function http(string $method, string $route, array $payload = [ ]) |
|
68 | 68 | { |
69 | 69 | return $this->sendRequest($method, $route, $payload, true); |
70 | 70 | } |
71 | 71 | |
72 | - private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
72 | + private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
73 | 73 | { |
74 | 74 | return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
75 | 75 | 'Authorization' => 'Bearer '.$this->getAuth0Service()->getTestUserToken()->id_token, |
76 | - ] : []); |
|
76 | + ] : [ ]); |
|
77 | 77 | } |
78 | 78 | |
79 | - protected function sendRequestWithToken($token, string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
79 | + protected function sendRequestWithToken($token, string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
80 | 80 | { |
81 | 81 | return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
82 | 82 | 'Authorization' => 'Bearer '.$token, |
83 | - ] : []); |
|
83 | + ] : [ ]); |
|
84 | 84 | } |
85 | 85 | |
86 | - protected function httpNoAuth(string $method, string $route, array $payload = []) |
|
86 | + protected function httpNoAuth(string $method, string $route, array $payload = [ ]) |
|
87 | 87 | { |
88 | 88 | return $this->sendRequest($method, $route, $payload, false); |
89 | 89 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | protected function includeRelations() |
33 | 33 | { |
34 | - $relations = []; |
|
34 | + $relations = [ ]; |
|
35 | 35 | foreach ($this->relations as $relation) { |
36 | 36 | if (is_string($relation) && method_exists(static::class, 'transform'.ucfirst(strtolower($relation)))) { |
37 | 37 | $method = 'transform'.ucfirst(strtolower($relation)); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if ($data instanceof JsonResource) { |
40 | 40 | $data->jsonSerialize(); |
41 | 41 | } |
42 | - $relations[strtolower($relation)] = $data; |
|
42 | + $relations[ strtolower($relation) ] = $data; |
|
43 | 43 | } else { |
44 | 44 | throw new \Exception('invalid relation or not relation_transform_method given in '.get_short_class_name(static::class)); |
45 | 45 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return static::$caching; |
31 | 31 | } |
32 | 32 | |
33 | - public static function find($id, $columns = ['*']) |
|
33 | + public static function find($id, $columns = [ '*' ]) |
|
34 | 34 | { |
35 | 35 | if (static::cache()->enabled()) { |
36 | 36 | $model = static::cache()->find($id) ?? static::recache($id); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return $model; |
50 | 50 | } |
51 | 51 | |
52 | - public static function findWithoutCache($id, $columns = ['*']) |
|
52 | + public static function findWithoutCache($id, $columns = [ '*' ]) |
|
53 | 53 | { |
54 | 54 | $model = new static(); |
55 | 55 | if (is_array($id) || $id instanceof Arrayable) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
68 | - if ($columns !== ['*']) { |
|
68 | + if ($columns !== [ '*' ]) { |
|
69 | 69 | return collect($model)->first($columns); |
70 | 70 | } |
71 | 71 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | /** |
34 | 34 | * @var array |
35 | 35 | */ |
36 | - protected $guarded = []; |
|
36 | + protected $guarded = [ ]; |
|
37 | 37 | |
38 | 38 | protected $casts = [ |
39 | 39 | 'online' => 'boolean', |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | $this->app->register(\Jenssegers\Mongodb\MongodbServiceProvider::class); |
18 | 18 | $this->app->register(\Jenssegers\Mongodb\MongodbQueueServiceProvider::class); |
19 | - DB::connection( 'mongodb' )->enableQueryLog(); |
|
19 | + DB::connection('mongodb')->enableQueryLog(); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 |
@@ -25,11 +25,11 @@ |
||
25 | 25 | { |
26 | 26 | $this->app->register(\Auth0\Login\LoginServiceProvider::class); |
27 | 27 | |
28 | - $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function () { |
|
28 | + $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function() { |
|
29 | 29 | return new Auth0Service(new UserService()); |
30 | 30 | }); |
31 | 31 | |
32 | - $this->app->bind(Auth0ServiceContract::class, function () { |
|
32 | + $this->app->bind(Auth0ServiceContract::class, function() { |
|
33 | 33 | return new Auth0Service(new UserService()); |
34 | 34 | }); |
35 | 35 | } |