@@ -13,11 +13,11 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | 'supportsCredentials' => false, |
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 | ]; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { |
|
4 | - $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; |
|
3 | +if (isset($_SERVER[ 'HTTP_CF_CONNECTING_IP' ])) { |
|
4 | + $_SERVER[ 'REMOTE_ADDR' ] = $_SERVER[ 'HTTP_CF_CONNECTING_IP' ]; |
|
5 | 5 | } |
@@ -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, |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | use Modules\User\Entities\User; |
4 | 4 | |
5 | -$factory->define(User::class, function (Faker\Generator $faker) { |
|
5 | +$factory->define(User::class, function(Faker\Generator $faker) { |
|
6 | 6 | return [ |
7 | 7 | 'provider' => 'database', |
8 | 8 | 'identity_id' => (new \MongoDB\BSON\ObjectId())->__toString(), |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | private function validateRequiredAttributes(\stdClass $profile) |
26 | 26 | { |
27 | - return array_keys_exists($this->requiredAttributes, (array)$profile); |
|
27 | + return array_keys_exists($this->requiredAttributes, (array) $profile); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $profile = $this->transformer->transformProfile($this->profile); |
116 | 116 | |
117 | 117 | if ($this->profileHasChanged()) { |
118 | - $profile['provider'] = $this->identityProvider; |
|
118 | + $profile[ 'provider' ] = $this->identityProvider; |
|
119 | 119 | $this->user->fill($profile); |
120 | 120 | $this->user->save(); |
121 | 121 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | protected function profileHasChanged(): bool |
127 | 127 | { |
128 | 128 | $user = $this->user->toArray(); |
129 | - $profile = (array)$this->profile; |
|
129 | + $profile = (array) $this->profile; |
|
130 | 130 | |
131 | 131 | return !array_is_subset_of($profile, $user); |
132 | 132 | } |
@@ -31,7 +31,7 @@ |
||
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 | } |
@@ -11,6 +11,6 @@ |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | -Broadcast::channel('user.{id}', function ($user, $id) { |
|
15 | - return $user->identity_id === $id; |
|
14 | +Broadcast::channel('user.{id}', function($user, $id) { |
|
15 | + return $user->identity_id === $id; |
|
16 | 16 | }); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | public static function findOrRequery($id, $modelClass) |
30 | 30 | { |
31 | - return Cache::remember(self::getCacheName($id, $modelClass), self::getCacheTime(),function () use ($id, $modelClass) { |
|
31 | + return Cache::remember(self::getCacheName($id, $modelClass), self::getCacheTime(), function() use ($id, $modelClass) { |
|
32 | 32 | return $modelClass::findWithoutCache($id); |
33 | 33 | }); |
34 | 34 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public static function getCacheName($id, $modelClass) |
40 | 40 | { |
41 | - return config('model.cache_prefix') . ':' . strtolower(get_short_class_name($modelClass)) . ':' . $id; |
|
41 | + return config('model.cache_prefix').':'.strtolower(get_short_class_name($modelClass)).':'.$id; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | private static function deleteWithPrefix($prefix) |
94 | 94 | { |
95 | 95 | $redis = self::getCacheConnection(); |
96 | - $keyPattern = Cache::getPrefix() . $prefix . '*'; |
|
96 | + $keyPattern = Cache::getPrefix().$prefix.'*'; |
|
97 | 97 | $keys = $redis->keys($keyPattern); |
98 | 98 | $redis->delete($keys); |
99 | 99 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public static function clearModel($modelClass) |
121 | 121 | { |
122 | - $pattern = config('model.cache_prefix') . ':' . strtolower(get_short_class_name($modelClass)); |
|
122 | + $pattern = config('model.cache_prefix').':'.strtolower(get_short_class_name($modelClass)); |
|
123 | 123 | self::deleteWithPrefix($pattern); |
124 | 124 | } |
125 | 125 | } |