@@ -117,8 +117,8 @@ |
||
117 | 117 | public function updateRememberToken(UserContract $user, string $token): void |
118 | 118 | { |
119 | 119 | $this->connection->table($this->table) |
120 | - ->where($user->getAuthIdentifierName(), $user->getAuthIdentifier()) |
|
121 | - ->update([$user->getRememberTokenName() => $token]); |
|
120 | + ->where($user->getAuthIdentifierName(), $user->getAuthIdentifier()) |
|
121 | + ->update([$user->getRememberTokenName() => $token]); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -130,7 +130,7 @@ |
||
130 | 130 | */ |
131 | 131 | public function retrieveByCredentials(array $credentials) |
132 | 132 | { |
133 | - $credentials = array_filter($credentials, function ($key) { |
|
133 | + $credentials = array_filter($credentials, function($key) { |
|
134 | 134 | return ! Str::contains($key, 'password'); |
135 | 135 | }, ARRAY_FILTER_USE_KEY); |
136 | 136 |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @return static |
137 | 137 | */ |
138 | - public function define(string $ability, callable|string $callback): static |
|
138 | + public function define(string $ability, callable | string $callback): static |
|
139 | 139 | { |
140 | 140 | if (is_array($callback) && isset($callback[0]) && is_string($callback[0])) { |
141 | 141 | $callback = $callback[0].'@'.$callback[1]; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | protected function buildAbilityCallback(string $ability, string $callback) |
189 | 189 | { |
190 | - return function () use ($ability, $callback) { |
|
190 | + return function() use ($ability, $callback) { |
|
191 | 191 | if (Str::contains($callback, '@')) { |
192 | 192 | [$class, $method] = Str::parseCallback($callback); |
193 | 193 | } else { |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | */ |
484 | 484 | protected function resolvePolicyCallback($user, string $ability, array $arguments): callable |
485 | 485 | { |
486 | - return function () use ($user, $ability, $arguments) { |
|
486 | + return function() use ($user, $ability, $arguments) { |
|
487 | 487 | $class = headItem($arguments); |
488 | 488 | |
489 | 489 | if (method_exists($instance = $this->getPolicyFor($class), 'before')) { |
@@ -440,8 +440,7 @@ |
||
440 | 440 | { |
441 | 441 | if ($this->firstArgumentToPolicy($arguments)) { |
442 | 442 | return $this->resolvePolicyCallback($user, $ability, $arguments); |
443 | - } |
|
444 | - elseif (isset($this->abilities[$ability])) { |
|
443 | + } elseif (isset($this->abilities[$ability])) { |
|
445 | 444 | return $this->abilities[$ability]; |
446 | 445 | } |
447 | 446 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * @license https://opensource.org/licenses/BSD-3-Clause New BSD license or see https://lenevor.com/license or see /license.md |
21 | 21 | */ |
22 | 22 | |
23 | - namespace Syscodes\Components\Auth\Access\Exceptions; |
|
23 | + namespace Syscodes\Components\Auth\Access\Exceptions; |
|
24 | 24 | |
25 | 25 | use Exception; |
26 | 26 | use Throwable; |
@@ -204,7 +204,7 @@ |
||
204 | 204 | $config['input_key'] ?? 'api_token', |
205 | 205 | $config['storage_key'] ?? 'api_token', |
206 | 206 | $config['hash'] ?? false |
207 | - ); |
|
207 | + ); |
|
208 | 208 | |
209 | 209 | $this->app->refresh('request', $guard, 'setRequest'); |
210 | 210 |
@@ -32,11 +32,11 @@ |
||
32 | 32 | */ |
33 | 33 | class AuthServiceProvider extends ServiceProvider |
34 | 34 | { |
35 | - /** |
|
36 | - * Register the service provider. |
|
37 | - * |
|
38 | - * @return void |
|
39 | - */ |
|
35 | + /** |
|
36 | + * Register the service provider. |
|
37 | + * |
|
38 | + * @return void |
|
39 | + */ |
|
40 | 40 | public function register() |
41 | 41 | { |
42 | 42 | $this->registerAuthenticator(); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | */ |
84 | 84 | protected function registerAccessGate() |
85 | 85 | { |
86 | - $this->app->singleton(GateContract::class, function ($app) { |
|
86 | + $this->app->singleton(GateContract::class, function($app) { |
|
87 | 87 | return new Gate($app, fn() => call_user_func($app['auth']->userResolver())); |
88 | 88 | }); |
89 | 89 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function register() |
40 | 40 | { |
41 | - $this->app->singleton('encrypter', function ($app) { |
|
41 | + $this->app->singleton('encrypter', function($app) { |
|
42 | 42 | $config = $app->make('config')->get('security'); |
43 | 43 | |
44 | 44 | return new Encrypter($this->parseKey($config), $config['cipher']); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | protected function key(array $config) |
74 | 74 | { |
75 | - return take($config['key'], function ($key) { |
|
75 | + return take($config['key'], function($key) { |
|
76 | 76 | if (empty($key)) { |
77 | 77 | throw new RuntimeException('No application encryption key has been specified.'); |
78 | 78 | } |
@@ -232,7 +232,7 @@ |
||
232 | 232 | return hash_equals( |
233 | 233 | hash_hmac('sha256', $payload['hmac'], $bytes, true), |
234 | 234 | $calc |
235 | - ); |
|
235 | + ); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -65,7 +65,7 @@ |
||
65 | 65 | if (static::supported($key, $cipher)) { |
66 | 66 | $this->key = $key; |
67 | 67 | $this->cipher = $cipher; |
68 | - } else { |
|
68 | + } else { |
|
69 | 69 | throw new RuntimeException('The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths'); |
70 | 70 | } |
71 | 71 | } |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | $text = ''; |
45 | 45 | |
46 | 46 | $options = \array_merge([ |
47 | - 'leftChar' => '', // e.g ' ', ' * ' |
|
48 | - 'sepChar' => ' ', // e.g ' | ' OUT: key | value |
|
49 | - 'keyStyle' => '', // e.g 'info','comment' |
|
50 | - 'valStyle' => '', // e.g 'info','comment' |
|
47 | + 'leftChar' => '', // e.g ' ', ' * ' |
|
48 | + 'sepChar' => ' ', // e.g ' | ' OUT: key | value |
|
49 | + 'keyStyle' => '', // e.g 'info','comment' |
|
50 | + 'valStyle' => '', // e.g 'info','comment' |
|
51 | 51 | 'keyMinWidth' => 8, |
52 | 52 | 'keyMaxWidth' => 0, |
53 | 53 | 'keyPadPos' => 'right', |
54 | - 'ucFirst' => true, // upper first char for value |
|
54 | + 'ucFirst' => true, // upper first char for value |
|
55 | 55 | ], $options); |
56 | 56 | |
57 | 57 | $keyStyle = \trim($options['keyStyle']); |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | $val = \is_scalar($val) ? (string) $val : $val; |
87 | 87 | } |
88 | 88 | |
89 | - $temp .= ( ! \is_numeric($k) ? "$k: " : '') . "$val, "; |
|
89 | + $temp .= ( ! \is_numeric($k) ? "$k: " : '')."$val, "; |
|
90 | 90 | } |
91 | 91 | |
92 | - $value = \rtrim($temp, ' ,') . ']'; |
|
92 | + $value = \rtrim($temp, ' ,').']'; |
|
93 | 93 | } elseif (\is_bool($value)) { |
94 | 94 | $value = $value ? '(True)' : '(False)'; |
95 | 95 | } else { |
@@ -36,15 +36,15 @@ |
||
36 | 36 | * @param |
37 | 37 | */ |
38 | 38 | /** |
39 | - * Returns a well formatted table. |
|
40 | - * |
|
41 | - * @param array $tbody List of rows |
|
42 | - * @param array $thead List of columns |
|
43 | - * |
|
44 | - * @return void |
|
45 | - */ |
|
46 | - public static function table(array $tbody, array $thead = []) |
|
47 | - { |
|
39 | + * Returns a well formatted table. |
|
40 | + * |
|
41 | + * @param array $tbody List of rows |
|
42 | + * @param array $thead List of columns |
|
43 | + * |
|
44 | + * @return void |
|
45 | + */ |
|
46 | + public static function table(array $tbody, array $thead = []) |
|
47 | + { |
|
48 | 48 | |
49 | - } |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | \ No newline at end of file |