@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | protected $commands = []; |
65 | 65 | |
66 | 66 | /** |
67 | - * The event dispatcher instance. |
|
68 | - * |
|
69 | - * @var \Syscodes\Components\Contracts\Events\Dispatcher $events |
|
70 | - */ |
|
71 | - protected $events; |
|
67 | + * The event dispatcher instance. |
|
68 | + * |
|
69 | + * @var \Syscodes\Components\Contracts\Events\Dispatcher $events |
|
70 | + */ |
|
71 | + protected $events; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * The Prime application instance. |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | * Shutdown the application. |
153 | 153 | * |
154 | 154 | * @param \Syscodes\Components\Contracts\Console\Input\Input $input |
155 | - * @param int $status |
|
155 | + * @param int $status |
|
156 | 156 | * |
157 | 157 | * @return void |
158 | 158 | */ |
@@ -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 | } |
@@ -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 | } |
@@ -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 |
@@ -519,7 +519,7 @@ |
||
519 | 519 | * |
520 | 520 | * @param \Syscodes\Components\Console\Command\Command $command The command name |
521 | 521 | * @param \Syscodes\Components\Contracts\Console\Input\Input $input The input interface implemented |
522 | - * @param \Syscodes\Components\Contracts\Console\Output\Output $output The output interface implemented |
|
522 | + * @param \Syscodes\Components\Contracts\Console\Output\Output $output The output interface implemented |
|
523 | 523 | * |
524 | 524 | * @return int 0 if everything went fine, or an error code |
525 | 525 | */ |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | try { |
282 | 282 | $this->runningCommand = null; |
283 | 283 | $command = $this->findCommand($name); |
284 | - } catch(Throwable $e) { |
|
284 | + } catch (Throwable $e) { |
|
285 | 285 | if ( ! ($e instanceof CommandNotFoundException && ! $e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || ! $input->isInteractive()) { |
286 | 286 | throw $e; |
287 | 287 | } |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | |
437 | 437 | if ($alternatives = $this->findCommandAlternatives($name, $allCommands)) { |
438 | 438 | // remove hidden commands |
439 | - $alternatives = array_filter($alternatives, function ($name) { |
|
439 | + $alternatives = array_filter($alternatives, function($name) { |
|
440 | 440 | return ! $this->get($name)->isHidden(); |
441 | 441 | }); |
442 | 442 | |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | |
583 | 583 | $commands = $this->commands; |
584 | 584 | foreach ($this->commandLoader->getNames() as $name) { |
585 | - if (!isset($commands[$name]) && $this->has($name)) { |
|
585 | + if ( ! isset($commands[$name]) && $this->has($name)) { |
|
586 | 586 | $commands[$name] = $this->get($name); |
587 | 587 | } |
588 | 588 | } |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | } |
755 | 755 | } |
756 | 756 | |
757 | - $alternatives = array_filter($alternatives, function ($levenhtein) use ($threshold) { |
|
757 | + $alternatives = array_filter($alternatives, function($levenhtein) use ($threshold) { |
|
758 | 758 | return $levenhtein < 2 * $threshold; |
759 | 759 | }); |
760 | 760 |