@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | |
45 | 45 | private function getUserTokenData(): \stdClass |
46 | 46 | { |
47 | - return Cache::remember('testing:http_access_token', 60, function () { |
|
47 | + return Cache::remember('testing:http_access_token', 60, function() { |
|
48 | 48 | try { |
49 | 49 | $httpClient = new Client(); |
50 | - $response = $httpClient->post(config('laravel-auth0.domain') . 'oauth/token', [ |
|
50 | + $response = $httpClient->post(config('laravel-auth0.domain').'oauth/token', [ |
|
51 | 51 | 'form_params' => [ |
52 | 52 | 'grant_type' => 'password', |
53 | 53 | 'client_id' => env('AUTH0_CLIENT_ID'), |
@@ -66,30 +66,30 @@ discard block |
||
66 | 66 | protected function decodeHttpContent($content, $unwrap = true) |
67 | 67 | { |
68 | 68 | if ($unwrap) |
69 | - return json_decode($content, true)['data']; |
|
69 | + return json_decode($content, true)[ 'data' ]; |
|
70 | 70 | return json_decode($content, true); |
71 | 71 | } |
72 | 72 | |
73 | - protected function http(string $method, string $route, array $payload = []) |
|
73 | + protected function http(string $method, string $route, array $payload = [ ]) |
|
74 | 74 | { |
75 | 75 | return $this->sendRequest($method, $route, $payload, true); |
76 | 76 | } |
77 | 77 | |
78 | - private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
78 | + private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
79 | 79 | { |
80 | - return $this->json($method, env('API_URL') . '/' . $route, $payload, $authenticated ? [ |
|
81 | - 'Authorization' => 'Bearer ' . $this->getUserTokenData()->id_token, |
|
82 | - ] : []); |
|
80 | + return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
|
81 | + 'Authorization' => 'Bearer '.$this->getUserTokenData()->id_token, |
|
82 | + ] : [ ]); |
|
83 | 83 | } |
84 | 84 | |
85 | - protected function sendRequestWithToken($token, string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
85 | + protected function sendRequestWithToken($token, string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
86 | 86 | { |
87 | - return $this->json($method, env('API_URL') . '/' . $route, $payload, $authenticated ? [ |
|
88 | - 'Authorization' => 'Bearer ' . $token, |
|
89 | - ] : []); |
|
87 | + return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
|
88 | + 'Authorization' => 'Bearer '.$token, |
|
89 | + ] : [ ]); |
|
90 | 90 | } |
91 | 91 | |
92 | - protected function httpNoAuth(string $method, string $route, array $payload = []) |
|
92 | + protected function httpNoAuth(string $method, string $route, array $payload = [ ]) |
|
93 | 93 | { |
94 | 94 | return $this->sendRequest($method, $route, $payload, false); |
95 | 95 | } |
@@ -65,8 +65,9 @@ |
||
65 | 65 | |
66 | 66 | protected function decodeHttpContent($content, $unwrap = true) |
67 | 67 | { |
68 | - if ($unwrap) |
|
69 | - return json_decode($content, true)['data']; |
|
68 | + if ($unwrap) { |
|
69 | + return json_decode($content, true)['data']; |
|
70 | + } |
|
70 | 71 | return json_decode($content, true); |
71 | 72 | } |
72 | 73 |
@@ -14,23 +14,23 @@ |
||
14 | 14 | { |
15 | 15 | protected $connection = 'mysql'; |
16 | 16 | |
17 | - public static function find($id, $columns = ['*']) |
|
17 | + public static function find($id, $columns = [ '*' ]) |
|
18 | 18 | { |
19 | - if ((bool)config('model.caching')) { |
|
19 | + if ((bool) config('model.caching')) { |
|
20 | 20 | $model = ModelCache::findOrRequery($id, get_called_class()); |
21 | 21 | return self::filterFromColumns($model, $columns); |
22 | 22 | } |
23 | 23 | return self::findWithoutCache($id, $columns); |
24 | 24 | } |
25 | 25 | |
26 | - public static function findWithoutCache($id, $columns = ['*']) |
|
26 | + public static function findWithoutCache($id, $columns = [ '*' ]) |
|
27 | 27 | { |
28 | 28 | return parent::find($id, $columns); |
29 | 29 | } |
30 | 30 | |
31 | 31 | private static function filterFromColumns($model, $columns) |
32 | 32 | { |
33 | - if ($columns !== ['*']) { |
|
33 | + if ($columns !== [ '*' ]) { |
|
34 | 34 | return collect($model)->first($columns); |
35 | 35 | } |
36 | 36 | return $model; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->assertCount(2, $notifications); |
35 | 35 | $notification = $user->unreadNotifications()->first(); |
36 | 36 | $notificationId = $notification->getKey(); |
37 | - $response = $this->http('POST', 'v1/notifications/' . $notificationId); |
|
37 | + $response = $this->http('POST', 'v1/notifications/'.$notificationId); |
|
38 | 38 | $response->assertStatus(200); |
39 | 39 | $unreadnotifications = User::find($user->getKey())->unreadNotifications; |
40 | 40 | $this->assertCount(1, $unreadnotifications); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $response->assertStatus(200); |
50 | 50 | $notificationsReponse = $this->decodeHttpContent($response->getContent()); |
51 | 51 | $notifications = NotificationResource::collection(User::find($user->getKey())->notifications)->jsonSerialize(); |
52 | - $this->assertEquals($notificationsReponse, (array)$notifications); |
|
52 | + $this->assertEquals($notificationsReponse, (array) $notifications); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function testUnreadNotificationsRoute() |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $user->notifyNow(new UserRegisteredNotification($user)); |
61 | 61 | $notification = $user->unreadNotifications()->first(); |
62 | 62 | $notificationId = $notification->getKey(); |
63 | - $response = $this->http('POST', 'v1/notifications/' . $notificationId); |
|
63 | + $response = $this->http('POST', 'v1/notifications/'.$notificationId); |
|
64 | 64 | $response->assertStatus(200); |
65 | 65 | $response = $this->http('GET', 'v1/notifications/unread'); |
66 | 66 | $response->assertStatus(200); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $id = $user->getKey(); |
21 | 21 | $response = $this->http('POST', '/broadcasting/auth', [ |
22 | 22 | 'socket_id' => '125200.2991064', |
23 | - 'channel_name' => 'private-user.' . $id |
|
23 | + 'channel_name' => 'private-user.'.$id |
|
24 | 24 | ]); |
25 | 25 | $response->assertStatus(200); |
26 | 26 | $this->assertArrayHasKey('auth', $this->decodeHttpContent($response->content(), false)); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $response = $this->http('POST', '/broadcasting/auth', [ |
32 | 32 | 'socket_id' => '125200.2991064', |
33 | - 'channel_name' => 'private-user.' . new ObjectId() |
|
33 | + 'channel_name' => 'private-user.'.new ObjectId() |
|
34 | 34 | ]); |
35 | 35 | $response->assertStatus(403); |
36 | 36 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | private function storeInCache($data) |
56 | 56 | { |
57 | - file_put_contents($this->getCachePath(), '<?php return ' . var_export($data, true) . ';'); |
|
57 | + file_put_contents($this->getCachePath(), '<?php return '.var_export($data, true).';'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | private function getCachePath(): string |
85 | 85 | { |
86 | - return app()->bootstrapPath() . '/cache/' . $this->cacheFile; |
|
86 | + return app()->bootstrapPath().'/cache/'.$this->cacheFile; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private function buildEmptyBootstrapArray() |
93 | 93 | { |
94 | - $bootstrapArray = []; |
|
94 | + $bootstrapArray = [ ]; |
|
95 | 95 | foreach ($this->moduleEntityDirectories as $key => $directory) { |
96 | - $bootstrapArray[$key] = []; |
|
96 | + $bootstrapArray[ $key ] = [ ]; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return $bootstrapArray; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $moduleNames = array_diff(scandir($path), array('..', '.')); |
109 | 109 | $modules = array(); |
110 | 110 | foreach ($moduleNames as $moduleName) { |
111 | - $modules[$moduleName] = $path . '/' . $moduleName; |
|
111 | + $modules[ $moduleName ] = $path.'/'.$moduleName; |
|
112 | 112 | } |
113 | 113 | return $modules; |
114 | 114 | } |
@@ -124,51 +124,51 @@ discard block |
||
124 | 124 | if (is_dir($modulePath)) { |
125 | 125 | foreach ($this->moduleEntityDirectories as $key => $directory) { |
126 | 126 | $directory = ucfirst($directory); |
127 | - $directoryPath = $modulePath . '/' . $directory; |
|
128 | - $namespace = 'Modules' . '\\' . $moduleName; |
|
127 | + $directoryPath = $modulePath.'/'.$directory; |
|
128 | + $namespace = 'Modules'.'\\'.$moduleName; |
|
129 | 129 | if (is_dir($directoryPath)) { |
130 | 130 | $files = scandir($directoryPath); |
131 | 131 | foreach ($files as $fileName) { |
132 | 132 | if ($this->hasPhpExtension($fileName)) { |
133 | 133 | $className = basename($fileName, '.php'); |
134 | - $class = $namespace . '\\' . str_replace('/', '\\', $directory) . '\\' . $className; |
|
134 | + $class = $namespace.'\\'.str_replace('/', '\\', $directory).'\\'.$className; |
|
135 | 135 | switch ($key) { |
136 | 136 | case 'commands': |
137 | 137 | try { |
138 | 138 | $command = new $class(); |
139 | 139 | if ($command instanceof Command) { |
140 | - $bootstrap[$key][] = $class; |
|
140 | + $bootstrap[ $key ][ ] = $class; |
|
141 | 141 | } |
142 | 142 | } catch (\Exception $e) { |
143 | 143 | break; |
144 | 144 | } |
145 | 145 | break; |
146 | 146 | case 'routes': |
147 | - $bootstrap[$key][] = $this->buildRouteArray($directoryPath . '/' . $fileName, $namespace); |
|
147 | + $bootstrap[ $key ][ ] = $this->buildRouteArray($directoryPath.'/'.$fileName, $namespace); |
|
148 | 148 | break; |
149 | 149 | case 'configs': |
150 | - $bootstrap[$key][] = $this->buildConfigArray($directoryPath . '/' . $fileName, $moduleName, $fileName); |
|
150 | + $bootstrap[ $key ][ ] = $this->buildConfigArray($directoryPath.'/'.$fileName, $moduleName, $fileName); |
|
151 | 151 | break; |
152 | 152 | case 'factories': |
153 | - $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath); |
|
153 | + $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath); |
|
154 | 154 | break; |
155 | 155 | case 'migrations': |
156 | - $bootstrap[$key][] = $this->buildDirectoryPathArray($directoryPath); |
|
156 | + $bootstrap[ $key ][ ] = $this->buildDirectoryPathArray($directoryPath); |
|
157 | 157 | break; |
158 | 158 | case 'seeders': |
159 | - $bootstrap[$key][] = $class; |
|
159 | + $bootstrap[ $key ][ ] = $class; |
|
160 | 160 | break; |
161 | 161 | case 'models': |
162 | - $bootstrap[$key][] = $class; |
|
162 | + $bootstrap[ $key ][ ] = $class; |
|
163 | 163 | break; |
164 | 164 | case 'policies': |
165 | - $bootstrap[$key][] = $this->buildPolicyArray($class, $namespace); |
|
165 | + $bootstrap[ $key ][ ] = $this->buildPolicyArray($class, $namespace); |
|
166 | 166 | break; |
167 | 167 | case 'providers': |
168 | - $bootstrap[$key][] = $class; |
|
168 | + $bootstrap[ $key ][ ] = $class; |
|
169 | 169 | break; |
170 | 170 | case 'events': |
171 | - $bootstrap[$key][] = $this->buildEventsArray($class); |
|
171 | + $bootstrap[ $key ][ ] = $this->buildEventsArray($class); |
|
172 | 172 | break; |
173 | 173 | default: |
174 | 174 | break; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | private function hasPhpExtension(string $fileName): bool |
192 | 192 | { |
193 | - return strlen($fileName) > 4 && '.php' === ($fileName[-4] . $fileName[-3] . $fileName[-2] . $fileName[-1]); |
|
193 | + return strlen($fileName) > 4 && '.php' === ($fileName[-4 ].$fileName[-3 ].$fileName[-2 ].$fileName[-1 ]); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | $apiDomain = str_replace('http://', '', $apiDomain); |
222 | 222 | $apiDomain = str_replace('https://', '', $apiDomain); |
223 | 223 | $moduleNamespace = $namespace; |
224 | - $moduleName = explode('\\', $moduleNamespace)[1]; |
|
225 | - $controllerNamespace = $moduleNamespace . '\\' . 'Http\\Controllers'; |
|
226 | - $modelNameSpace = $moduleNamespace . '\\' . 'Entities\\' . $moduleName; |
|
224 | + $moduleName = explode('\\', $moduleNamespace)[ 1 ]; |
|
225 | + $controllerNamespace = $moduleNamespace.'\\'.'Http\\Controllers'; |
|
226 | + $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName; |
|
227 | 227 | |
228 | 228 | return [ |
229 | 229 | 'path' => $path, |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | private function buildPolicyArray($class, $namespace) |
245 | 245 | { |
246 | 246 | $moduleNamespace = $namespace; |
247 | - $moduleName = explode('\\', $moduleNamespace)[1]; |
|
248 | - $modelNameSpace = $moduleNamespace . '\\' . 'Entities\\' . $moduleName; |
|
247 | + $moduleName = explode('\\', $moduleNamespace)[ 1 ]; |
|
248 | + $modelNameSpace = $moduleNamespace.'\\'.'Entities\\'.$moduleName; |
|
249 | 249 | |
250 | 250 | return [ |
251 | 251 | 'class' => $class, |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | $listeners = array(); |
287 | 287 | foreach ($listenerProperties as $listener) { |
288 | 288 | if (class_implements_interface($listener, ListenerContract::class)) { |
289 | - $listeners[] = $listener; |
|
289 | + $listeners[ ] = $listener; |
|
290 | 290 | } |
291 | 291 | } |
292 | 292 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | */ |
302 | 302 | public function getCommands(): array |
303 | 303 | { |
304 | - return $this->loadBootstrapFromCache()['commands'] ?? []; |
|
304 | + return $this->loadBootstrapFromCache()[ 'commands' ] ?? [ ]; |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function getRoutes(): array |
311 | 311 | { |
312 | - return $this->loadBootstrapFromCache()['routes'] ?? []; |
|
312 | + return $this->loadBootstrapFromCache()[ 'routes' ] ?? [ ]; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | */ |
318 | 318 | public function getConfigs(): array |
319 | 319 | { |
320 | - return $this->loadBootstrapFromCache()['configs'] ?? []; |
|
320 | + return $this->loadBootstrapFromCache()[ 'configs' ] ?? [ ]; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function getFactories(): array |
327 | 327 | { |
328 | - return $this->loadBootstrapFromCache()['factories'] ?? []; |
|
328 | + return $this->loadBootstrapFromCache()[ 'factories' ] ?? [ ]; |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | */ |
334 | 334 | public function getMigrations(): array |
335 | 335 | { |
336 | - return $this->loadBootstrapFromCache()['migrations'] ?? []; |
|
336 | + return $this->loadBootstrapFromCache()[ 'migrations' ] ?? [ ]; |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | */ |
342 | 342 | public function getSeeders(): array |
343 | 343 | { |
344 | - return $this->loadBootstrapFromCache()['seeders'] ?? []; |
|
344 | + return $this->loadBootstrapFromCache()[ 'seeders' ] ?? [ ]; |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | */ |
350 | 350 | public function getModels(): array |
351 | 351 | { |
352 | - return $this->loadBootstrapFromCache()['models'] ?? []; |
|
352 | + return $this->loadBootstrapFromCache()[ 'models' ] ?? [ ]; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function getPolicies(): array |
359 | 359 | { |
360 | - return $this->loadBootstrapFromCache()['policies'] ?? []; |
|
360 | + return $this->loadBootstrapFromCache()[ 'policies' ] ?? [ ]; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | /** |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function getProviders(): array |
367 | 367 | { |
368 | - return $this->loadBootstrapFromCache()['providers'] ?? []; |
|
368 | + return $this->loadBootstrapFromCache()[ 'providers' ] ?? [ ]; |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
@@ -373,6 +373,6 @@ discard block |
||
373 | 373 | */ |
374 | 374 | public function getEvents(): array |
375 | 375 | { |
376 | - return $this->loadBootstrapFromCache()['events'] ?? []; |
|
376 | + return $this->loadBootstrapFromCache()[ 'events' ] ?? [ ]; |
|
377 | 377 | } |
378 | 378 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $this->artisan('migrate:fresh'); |
23 | 23 | $this->artisan('db:seed'); |
24 | 24 | |
25 | - $this->beforeApplicationDestroyed(function () { |
|
25 | + $this->beforeApplicationDestroyed(function() { |
|
26 | 26 | $this->artisan('cache:model:clear'); |
27 | 27 | $this->artisan('migrate:rollback'); |
28 | 28 | RefreshDatabaseState::$migrated = false; |
@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | |
16 | 16 | trait Cacheable |
17 | 17 | { |
18 | - public static function find($id, $columns = ['*']) |
|
18 | + public static function find($id, $columns = [ '*' ]) |
|
19 | 19 | { |
20 | - if ((bool)config('model.caching')) { |
|
20 | + if ((bool) config('model.caching')) { |
|
21 | 21 | $model = ModelCache::findOrRequery($id, get_called_class()); |
22 | 22 | return self::filterFromColumns($model, $columns); |
23 | 23 | } |
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) { |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | private static function filterFromColumns($model, $columns) |
37 | 37 | { |
38 | - if ($columns !== ['*']) { |
|
38 | + if ($columns !== [ '*' ]) { |
|
39 | 39 | return collect($model)->first($columns); |
40 | 40 | } |
41 | 41 | return $model; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @var array |
27 | 27 | */ |
28 | - protected $guarded = []; |
|
28 | + protected $guarded = [ ]; |
|
29 | 29 | /** |
30 | 30 | * The attributes that should be cast to native types. |
31 | 31 | * |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function markAsRead() |
53 | 53 | { |
54 | 54 | if (is_null($this->read_at)) { |
55 | - $this->forceFill(['read_at' => $this->freshTimestamp()])->save(); |
|
55 | + $this->forceFill([ 'read_at' => $this->freshTimestamp() ])->save(); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param array $models |
83 | 83 | * @return \Illuminate\Notifications\DatabaseNotificationCollection |
84 | 84 | */ |
85 | - public function newCollection(array $models = []) |
|
85 | + public function newCollection(array $models = [ ]) |
|
86 | 86 | { |
87 | 87 | return new DatabaseNotificationCollection($models); |
88 | 88 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $this->overrideSeedCommand(); |
31 | 31 | |
32 | - if ((bool)config('model.caching')) { |
|
32 | + if ((bool) config('model.caching')) { |
|
33 | 33 | $this->loadCacheObservers(); |
34 | 34 | } |
35 | 35 | |
@@ -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/' . $route['module'], |
|
80 | - 'namespace' => $route['controller'], |
|
81 | - 'domain' => $route['domain'], |
|
82 | - 'middleware' => ['api'], |
|
83 | - ], function () use ($path) { |
|
79 | + 'prefix' => 'v1/'.$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 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | foreach ($this->bootstrapService->getModels() as $model) { |
165 | 165 | if (class_implements_interface($model, Ownable::class)) { |
166 | 166 | Gate::policy($model, OwnershipPolicy::class); |
167 | - Gate::define('access', OwnershipPolicy::class . '@access'); |
|
167 | + Gate::define('access', OwnershipPolicy::class.'@access'); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | } |
@@ -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 | } |