@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | trait Cacheable |
15 | 15 | { |
16 | - public static function find($id, $columns = ['*']) |
|
16 | + public static function find($id, $columns = [ '*' ]) |
|
17 | 17 | { |
18 | 18 | if ((bool) config('model.caching')) { |
19 | 19 | $model = ModelCache::findOrRequery($id, get_called_class()); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | return static::findWithoutCache($id, $columns); |
25 | 25 | } |
26 | 26 | |
27 | - public static function findWithoutCache($id, $columns = ['*']) |
|
27 | + public static function findWithoutCache($id, $columns = [ '*' ]) |
|
28 | 28 | { |
29 | 29 | $model = new static(); |
30 | 30 | if (is_array($id) || $id instanceof Arrayable) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | private static function filterFromColumns($model, $columns) |
38 | 38 | { |
39 | - if ($columns !== ['*']) { |
|
39 | + if ($columns !== [ '*' ]) { |
|
40 | 40 | return collect($model)->first($columns); |
41 | 41 | } |
42 | 42 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | $randomIndex = random_int(0, count($array) - 1); |
44 | 44 | |
45 | - return $array[$randomIndex]; |
|
45 | + return $array[ $randomIndex ]; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | if (!function_exists('create_multiple_from_factory')) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $traits = array_flip(class_uses_recursive($class)); |
93 | 93 | |
94 | - return isset($traits[$trait]); |
|
94 | + return isset($traits[ $trait ]); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | if (!function_exists('array_keys_exists')) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | if (!function_exists('is_associative_array')) { |
136 | 136 | function is_associative_array(array $arr) |
137 | 137 | { |
138 | - if ([] === $arr) { |
|
138 | + if ([ ] === $arr) { |
|
139 | 139 | return false; |
140 | 140 | } |
141 | 141 |
@@ -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->identity_id === $id; |
16 | 16 | }); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @var array |
28 | 28 | */ |
29 | - protected $guarded = []; |
|
29 | + protected $guarded = [ ]; |
|
30 | 30 | /** |
31 | 31 | * The attributes that should be cast to native types. |
32 | 32 | * |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function markAsRead() |
54 | 54 | { |
55 | 55 | if (is_null($this->read_at)) { |
56 | - $this->forceFill(['read_at' => $this->freshTimestamp()])->save(); |
|
56 | + $this->forceFill([ 'read_at' => $this->freshTimestamp() ])->save(); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return \Illuminate\Notifications\DatabaseNotificationCollection |
86 | 86 | */ |
87 | - public function newCollection(array $models = []) |
|
87 | + public function newCollection(array $models = [ ]) |
|
88 | 88 | { |
89 | 89 | return new DatabaseNotificationCollection($models); |
90 | 90 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function boot() |
16 | 16 | { |
17 | 17 | Broadcast::routes([ |
18 | - 'middleware' => ['api'], |
|
18 | + 'middleware' => [ 'api' ], |
|
19 | 19 | 'domain' => env('API_URL'), |
20 | 20 | ]); |
21 | 21 |
@@ -74,16 +74,16 @@ discard block |
||
74 | 74 | private function loadRoutes() |
75 | 75 | { |
76 | 76 | foreach ($this->bootstrapService->getRoutes() as $route) { |
77 | - $path = $route['path']; |
|
77 | + $path = $route[ 'path' ]; |
|
78 | 78 | Route::group([ |
79 | - 'prefix' => 'v1/'.str_plural($route['module']), |
|
80 | - 'namespace' => $route['controller'], |
|
81 | - 'domain' => $route['domain'], |
|
82 | - 'middleware' => ['api'], |
|
83 | - ], function () use ($path) { |
|
79 | + 'prefix' => 'v1/'.str_plural($route[ 'module' ]), |
|
80 | + 'namespace' => $route[ 'controller' ], |
|
81 | + 'domain' => $route[ 'domain' ], |
|
82 | + 'middleware' => [ 'api' ], |
|
83 | + ], function() use ($path) { |
|
84 | 84 | require $path; |
85 | 85 | }); |
86 | - Route::model($route['module'], $route['model']); |
|
86 | + Route::model($route[ 'module' ], $route[ 'model' ]); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | protected function loadConfigs() |
96 | 96 | { |
97 | 97 | foreach ($this->bootstrapService->getConfigs() as $config) { |
98 | - if ($config['filename'] === 'config.php') { |
|
98 | + if ($config[ 'filename' ] === 'config.php') { |
|
99 | 99 | $this->publishes([ |
100 | - $config['path'] => config_path($config['module']), |
|
100 | + $config[ 'path' ] => config_path($config[ 'module' ]), |
|
101 | 101 | ], 'config'); |
102 | 102 | $this->mergeConfigFrom( |
103 | - $config['path'], basename($config['module'], '.php') |
|
103 | + $config[ 'path' ], basename($config[ 'module' ], '.php') |
|
104 | 104 | ); |
105 | 105 | } |
106 | 106 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | foreach ($this->bootstrapService->getFactories() as $factory) { |
117 | 117 | if (!$this->app->environment('production')) { |
118 | - app(Factory::class)->load($factory['path']); |
|
118 | + app(Factory::class)->load($factory[ 'path' ]); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | } |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | public function loadMigrations() |
129 | 129 | { |
130 | 130 | foreach ($this->bootstrapService->getMigrations() as $migration) { |
131 | - $this->loadMigrationsFrom($migration['path']); |
|
131 | + $this->loadMigrationsFrom($migration[ 'path' ]); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | 135 | private function loadPolicies() |
136 | 136 | { |
137 | 137 | foreach ($this->bootstrapService->getPolicies() as $policy) { |
138 | - if (class_implements_interface($policy['class'], ModelPolicyContract::class)) { |
|
139 | - Gate::policy($policy['model'], $policy['class']); |
|
138 | + if (class_implements_interface($policy[ 'class' ], ModelPolicyContract::class)) { |
|
139 | + Gate::policy($policy[ 'model' ], $policy[ 'class' ]); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | } |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | { |
146 | 146 | $app = $this->app; |
147 | 147 | $service = $this->bootstrapService; |
148 | - $this->app->extend('command.seed', function () use ($app, $service) { |
|
149 | - return new SeedCommand($app['db'], $service); |
|
148 | + $this->app->extend('command.seed', function() use ($app, $service) { |
|
149 | + return new SeedCommand($app[ 'db' ], $service); |
|
150 | 150 | }); |
151 | 151 | } |
152 | 152 | |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | private function loadListeners() |
180 | 180 | { |
181 | 181 | foreach ($this->bootstrapService->getEvents() as $event) { |
182 | - foreach ($event['listeners'] as $listener) { |
|
183 | - Event::listen($event['class'], $listener); |
|
182 | + foreach ($event[ 'listeners' ] as $listener) { |
|
183 | + Event::listen($event[ 'class' ], $listener); |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | } |
@@ -111,7 +111,7 @@ |
||
111 | 111 | $profile = $this->transformer->transformProfile($this->profile); |
112 | 112 | |
113 | 113 | if ($this->profileHasChanged()) { |
114 | - $profile['provider'] = $this->identityProvider; |
|
114 | + $profile[ 'provider' ] = $this->identityProvider; |
|
115 | 115 | $this->user->fill($profile); |
116 | 116 | $this->user->save(); |
117 | 117 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function getUserByUserInfo($userInfo) |
48 | 48 | { |
49 | - return $this->upsertUser($userInfo['profile']); |
|
49 | + return $this->upsertUser($userInfo[ 'profile' ]); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | protected function upsertUser($profile) |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | throw new BadRequestHttpException('Missing token information: Auth0 user id is not set'); |
56 | 56 | } |
57 | 57 | $identifier = explode('|', $profile->user_id); |
58 | - $identityProvider = $identifier[0]; |
|
59 | - $id = $identifier[1]; |
|
58 | + $identityProvider = $identifier[ 0 ]; |
|
59 | + $id = $identifier[ 1 ]; |
|
60 | 60 | |
61 | 61 | $user = $this->service->find($id); |
62 | 62 | $newUser = false; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | public function getPredefinedUserTokenData(): \stdClass |
88 | 88 | { |
89 | - return Cache::remember('testing:http_access_token', 60, function () { |
|
89 | + return Cache::remember('testing:http_access_token', 60, function() { |
|
90 | 90 | try { |
91 | 91 | $httpClient = new Client(); |
92 | 92 | $response = $httpClient->post(env('AUTH0_DOMAIN').'oauth/token', [ |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function boot() |
32 | 32 | { |
33 | - $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function () { |
|
33 | + $this->app->bind(\Auth0\Login\Contract\Auth0UserRepository::class, function() { |
|
34 | 34 | return new Auth0Service(new UserService()); |
35 | 35 | }); |
36 | 36 | } |