@@ -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 | } |
@@ -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', |
@@ -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 | } |
@@ -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 | |-------------------------------------------------------------------------- |
@@ -13,11 +13,11 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | 'supportsCredentials' => true, |
16 | - 'allowedOrigins' => ['*'], |
|
17 | - 'allowedOriginsPatterns' => [], |
|
18 | - 'allowedHeaders' => ['*'], |
|
19 | - 'allowedMethods' => ['*'], |
|
20 | - 'exposedHeaders' => [], |
|
16 | + 'allowedOrigins' => [ '*' ], |
|
17 | + 'allowedOriginsPatterns' => [ ], |
|
18 | + 'allowedHeaders' => [ '*' ], |
|
19 | + 'allowedMethods' => [ '*' ], |
|
20 | + 'exposedHeaders' => [ ], |
|
21 | 21 | 'maxAge' => 0, |
22 | 22 | |
23 | 23 | ]; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'production' => [ |
75 | 75 | 'supervisor-1' => [ |
76 | 76 | 'connection' => 'redis', |
77 | - 'queue' => ['default'], |
|
77 | + 'queue' => [ 'default' ], |
|
78 | 78 | 'balance' => 'simple', |
79 | 79 | 'processes' => 10, |
80 | 80 | 'tries' => 3, |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'local' => [ |
85 | 85 | 'supervisor-1' => [ |
86 | 86 | 'connection' => 'redis', |
87 | - 'queue' => ['default'], |
|
87 | + 'queue' => [ 'default' ], |
|
88 | 88 | 'balance' => 'simple', |
89 | 89 | 'processes' => 3, |
90 | 90 | 'tries' => 3, |
@@ -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'); |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function buildEmptyBootstrapArray() |
90 | 90 | { |
91 | - $bootstrapArray = []; |
|
91 | + $bootstrapArray = [ ]; |
|
92 | 92 | foreach ($this->moduleEntityDirectories as $key => $directory) { |
93 | - $bootstrapArray[$key] = []; |
|
93 | + $bootstrapArray[ $key ] = [ ]; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return $bootstrapArray; |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | private function getModules(): array |
103 | 103 | { |
104 | 104 | $path = base_path('src/Modules'); |
105 | - $moduleNames = array_diff(scandir($path), ['..', '.']); |
|
106 | - $modules = []; |
|
105 | + $moduleNames = array_diff(scandir($path), [ '..', '.' ]); |
|
106 | + $modules = [ ]; |
|
107 | 107 | foreach ($moduleNames as $moduleName) { |
108 | - $modules[$moduleName] = $path.'/'.$moduleName; |
|
108 | + $modules[ $moduleName ] = $path.'/'.$moduleName; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | return $modules; |
@@ -135,38 +135,38 @@ discard block |
||
135 | 135 | try { |
136 | 136 | $command = new $class(); |
137 | 137 | if ($command instanceof Command) { |
138 | - $bootstrap[$key][] = $class; |
|
138 | + $bootstrap[ $key ][ ] = $class; |
|
139 | 139 | } |
140 | 140 | } catch (\Exception $e) { |
141 | 141 | break; |
142 | 142 | } |
143 | 143 | break; |
144 | 144 | case 'routes': |
145 | - $bootstrap[$key][] = $this->buildRouteArray($directoryPath.'/'.$fileName, $namespace); |
|
145 | + $bootstrap[ $key ][ ] = $this->buildRouteArray($directoryPath.'/'.$fileName, $namespace); |
|
146 | 146 | break; |
147 | 147 | case 'configs': |
148 | - $bootstrap[$key][] = $this->buildConfigArray($directoryPath.'/'.$fileName, $moduleName, $fileName); |
|
148 | + $bootstrap[ $key ][ ] = $this->buildConfigArray($directoryPath.'/'.$fileName, $moduleName, $fileName); |
|
149 | 149 | break; |
150 | 150 | case 'factories': |
151 | - $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath); |
|
151 | + $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath); |
|
152 | 152 | break; |
153 | 153 | case 'migrations': |
154 | - $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath); |
|
154 | + $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath); |
|
155 | 155 | break; |
156 | 156 | case 'seeders': |
157 | - $bootstrap[$key][] = $class; |
|
157 | + $bootstrap[ $key ][ ] = $class; |
|
158 | 158 | break; |
159 | 159 | case 'models': |
160 | - $bootstrap[$key][] = $class; |
|
160 | + $bootstrap[ $key ][ ] = $class; |
|
161 | 161 | break; |
162 | 162 | case 'policies': |
163 | - $bootstrap[$key][] = $this->buildPolicyArray($class, $namespace); |
|
163 | + $bootstrap[ $key ][ ] = $this->buildPolicyArray($class, $namespace); |
|
164 | 164 | break; |
165 | 165 | case 'providers': |
166 | - $bootstrap[$key][] = $class; |
|
166 | + $bootstrap[ $key ][ ] = $class; |
|
167 | 167 | break; |
168 | 168 | case 'events': |
169 | - $bootstrap[$key][] = $this->buildEventsArray($class); |
|
169 | + $bootstrap[ $key ][ ] = $this->buildEventsArray($class); |
|
170 | 170 | break; |
171 | 171 | default: |
172 | 172 | break; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | private function hasPhpExtension(string $fileName): bool |
190 | 190 | { |
191 | - return strlen($fileName) > 4 && '.php' === ($fileName[-4].$fileName[-3].$fileName[-2].$fileName[-1]); |
|
191 | + return strlen($fileName) > 4 && '.php' === ($fileName[-4 ].$fileName[-3 ].$fileName[-2 ].$fileName[-1 ]); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $apiDomain = str_replace('http://', '', $apiDomain); |
220 | 220 | $apiDomain = str_replace('https://', '', $apiDomain); |
221 | 221 | $moduleNamespace = $namespace; |
222 | - $moduleName = explode('\\', $moduleNamespace)[1]; |
|
222 | + $moduleName = explode('\\', $moduleNamespace)[ 1 ]; |
|
223 | 223 | $controllerNamespace = $moduleNamespace.'\\'.'Http\\Controllers'; |
224 | 224 | $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName; |
225 | 225 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | private function buildPolicyArray($class, $namespace) |
243 | 243 | { |
244 | 244 | $moduleNamespace = $namespace; |
245 | - $moduleName = explode('\\', $moduleNamespace)[1]; |
|
245 | + $moduleName = explode('\\', $moduleNamespace)[ 1 ]; |
|
246 | 246 | $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName; |
247 | 247 | |
248 | 248 | return [ |
@@ -280,11 +280,11 @@ discard block |
||
280 | 280 | |
281 | 281 | private function buildEventsArray($class) |
282 | 282 | { |
283 | - $listenerProperties = get_class_property($class, 'listeners') ?? []; |
|
284 | - $listeners = []; |
|
283 | + $listenerProperties = get_class_property($class, 'listeners') ?? [ ]; |
|
284 | + $listeners = [ ]; |
|
285 | 285 | foreach ($listenerProperties as $listener) { |
286 | 286 | if (class_implements_interface($listener, ListenerContract::class)) { |
287 | - $listeners[] = $listener; |
|
287 | + $listeners[ ] = $listener; |
|
288 | 288 | } |
289 | 289 | } |
290 | 290 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | */ |
300 | 300 | public function getCommands(): array |
301 | 301 | { |
302 | - return $this->loadBootstrapFromCache()['commands'] ?? []; |
|
302 | + return $this->loadBootstrapFromCache()[ 'commands' ] ?? [ ]; |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | /** |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function getRoutes(): array |
309 | 309 | { |
310 | - return $this->loadBootstrapFromCache()['routes'] ?? []; |
|
310 | + return $this->loadBootstrapFromCache()[ 'routes' ] ?? [ ]; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | */ |
316 | 316 | public function getConfigs(): array |
317 | 317 | { |
318 | - return $this->loadBootstrapFromCache()['configs'] ?? []; |
|
318 | + return $this->loadBootstrapFromCache()[ 'configs' ] ?? [ ]; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public function getFactories(): array |
325 | 325 | { |
326 | - return $this->loadBootstrapFromCache()['factories'] ?? []; |
|
326 | + return $this->loadBootstrapFromCache()[ 'factories' ] ?? [ ]; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | /** |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | */ |
332 | 332 | public function getMigrations(): array |
333 | 333 | { |
334 | - return $this->loadBootstrapFromCache()['migrations'] ?? []; |
|
334 | + return $this->loadBootstrapFromCache()[ 'migrations' ] ?? [ ]; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public function getSeeders(): array |
341 | 341 | { |
342 | - return $this->loadBootstrapFromCache()['seeders'] ?? []; |
|
342 | + return $this->loadBootstrapFromCache()[ 'seeders' ] ?? [ ]; |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function getModels(): array |
349 | 349 | { |
350 | - return $this->loadBootstrapFromCache()['models'] ?? []; |
|
350 | + return $this->loadBootstrapFromCache()[ 'models' ] ?? [ ]; |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | public function getPolicies(): array |
357 | 357 | { |
358 | - return $this->loadBootstrapFromCache()['policies'] ?? []; |
|
358 | + return $this->loadBootstrapFromCache()[ 'policies' ] ?? [ ]; |
|
359 | 359 | } |
360 | 360 | |
361 | 361 | /** |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function getProviders(): array |
365 | 365 | { |
366 | - return $this->loadBootstrapFromCache()['providers'] ?? []; |
|
366 | + return $this->loadBootstrapFromCache()[ 'providers' ] ?? [ ]; |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
@@ -371,6 +371,6 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function getEvents(): array |
373 | 373 | { |
374 | - return $this->loadBootstrapFromCache()['events'] ?? []; |
|
374 | + return $this->loadBootstrapFromCache()[ 'events' ] ?? [ ]; |
|
375 | 375 | } |
376 | 376 | } |