@@ -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 |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | 'blink' => 5, |
| 60 | 60 | 'reverse' => 7, |
| 61 | 61 | 'conceal' => 8, |
| 62 | - ]; |
|
| 62 | + ]; |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Gets the background of CLI command. |
@@ -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 | |
@@ -67,14 +67,14 @@ |
||
| 67 | 67 | ), $options); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * Describes an InputOption instance. |
|
| 72 | - * |
|
| 73 | - * @param \Syscodes\Components\Console\Input\InputOption $option The option implemented |
|
| 74 | - * @param array $options The options of the console |
|
| 75 | - * |
|
| 76 | - * @return void |
|
| 77 | - */ |
|
| 70 | + /** |
|
| 71 | + * Describes an InputOption instance. |
|
| 72 | + * |
|
| 73 | + * @param \Syscodes\Components\Console\Input\InputOption $option The option implemented |
|
| 74 | + * @param array $options The options of the console |
|
| 75 | + * |
|
| 76 | + * @return void |
|
| 77 | + */ |
|
| 78 | 78 | protected function describeOption(InputOption $option, array $options = []) |
| 79 | 79 | { |
| 80 | 80 | if ($option->isAcceptValue() && null !== $option->getDefault() && ( ! is_array($option->getDefault()) || count($option->getDefault()))) { |
@@ -27,136 +27,136 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | trait InteractsIO |
| 29 | 29 | { |
| 30 | - /** |
|
| 31 | - * The output interface implementation. |
|
| 32 | - * |
|
| 33 | - * @var \Syscodes\Components\Contracts\Console\Output $output |
|
| 34 | - */ |
|
| 35 | - protected $output; |
|
| 30 | + /** |
|
| 31 | + * The output interface implementation. |
|
| 32 | + * |
|
| 33 | + * @var \Syscodes\Components\Contracts\Console\Output $output |
|
| 34 | + */ |
|
| 35 | + protected $output; |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Enter a number of empty lines. |
|
| 39 | - * |
|
| 40 | - * @param int $num Number of lines to output |
|
| 41 | - * |
|
| 42 | - * @return string |
|
| 43 | - */ |
|
| 44 | - public function newline(int $num = 1) |
|
| 45 | - { |
|
| 46 | - $this->newLine($num); |
|
| 47 | - } |
|
| 37 | + /** |
|
| 38 | + * Enter a number of empty lines. |
|
| 39 | + * |
|
| 40 | + * @param int $num Number of lines to output |
|
| 41 | + * |
|
| 42 | + * @return string |
|
| 43 | + */ |
|
| 44 | + public function newline(int $num = 1) |
|
| 45 | + { |
|
| 46 | + $this->newLine($num); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * Writes a string formatting for comment output. |
|
| 51 | - * |
|
| 52 | - * @param string $message |
|
| 53 | - * |
|
| 54 | - * @return void |
|
| 55 | - */ |
|
| 56 | - public function comment(string $message) |
|
| 57 | - { |
|
| 58 | - $this->commandline($message, 'comment'); |
|
| 59 | - } |
|
| 49 | + /** |
|
| 50 | + * Writes a string formatting for comment output. |
|
| 51 | + * |
|
| 52 | + * @param string $message |
|
| 53 | + * |
|
| 54 | + * @return void |
|
| 55 | + */ |
|
| 56 | + public function comment(string $message) |
|
| 57 | + { |
|
| 58 | + $this->commandline($message, 'comment'); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * Writes a string formatting for note output. |
|
| 63 | - * |
|
| 64 | - * @param string $message |
|
| 65 | - * |
|
| 66 | - * @return void |
|
| 67 | - */ |
|
| 68 | - public function note(string $message) |
|
| 69 | - { |
|
| 70 | - $this->commandline($message, 'note'); |
|
| 71 | - } |
|
| 61 | + /** |
|
| 62 | + * Writes a string formatting for note output. |
|
| 63 | + * |
|
| 64 | + * @param string $message |
|
| 65 | + * |
|
| 66 | + * @return void |
|
| 67 | + */ |
|
| 68 | + public function note(string $message) |
|
| 69 | + { |
|
| 70 | + $this->commandline($message, 'note'); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * Writes a string formatting for success output. |
|
| 75 | - * |
|
| 76 | - * @param string $message |
|
| 77 | - * |
|
| 78 | - * @return void |
|
| 79 | - */ |
|
| 80 | - public function success(string $message) |
|
| 81 | - { |
|
| 82 | - $this->commandline($message, 'success'); |
|
| 83 | - } |
|
| 73 | + /** |
|
| 74 | + * Writes a string formatting for success output. |
|
| 75 | + * |
|
| 76 | + * @param string $message |
|
| 77 | + * |
|
| 78 | + * @return void |
|
| 79 | + */ |
|
| 80 | + public function success(string $message) |
|
| 81 | + { |
|
| 82 | + $this->commandline($message, 'success'); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * Writes a string formatting for info output. |
|
| 87 | - * |
|
| 88 | - * @param string $message |
|
| 89 | - * |
|
| 90 | - * @return void |
|
| 91 | - */ |
|
| 92 | - public function info(string $message) |
|
| 93 | - { |
|
| 94 | - $this->commandline($message, 'info'); |
|
| 95 | - } |
|
| 85 | + /** |
|
| 86 | + * Writes a string formatting for info output. |
|
| 87 | + * |
|
| 88 | + * @param string $message |
|
| 89 | + * |
|
| 90 | + * @return void |
|
| 91 | + */ |
|
| 92 | + public function info(string $message) |
|
| 93 | + { |
|
| 94 | + $this->commandline($message, 'info'); |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - /** |
|
| 98 | - * Writes a string formatting for question output. |
|
| 99 | - * |
|
| 100 | - * @param string $message |
|
| 101 | - * |
|
| 102 | - * @return void |
|
| 103 | - */ |
|
| 104 | - public function question(string $message) |
|
| 105 | - { |
|
| 106 | - $this->commandline($message, 'question'); |
|
| 107 | - } |
|
| 97 | + /** |
|
| 98 | + * Writes a string formatting for question output. |
|
| 99 | + * |
|
| 100 | + * @param string $message |
|
| 101 | + * |
|
| 102 | + * @return void |
|
| 103 | + */ |
|
| 104 | + public function question(string $message) |
|
| 105 | + { |
|
| 106 | + $this->commandline($message, 'question'); |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * Writes a string formatting for warning output. |
|
| 111 | - * |
|
| 112 | - * @param string $message |
|
| 113 | - * |
|
| 114 | - * @return void |
|
| 115 | - */ |
|
| 116 | - public function warning(string $message) |
|
| 117 | - { |
|
| 118 | - $this->commandline($message, 'warning'); |
|
| 119 | - } |
|
| 109 | + /** |
|
| 110 | + * Writes a string formatting for warning output. |
|
| 111 | + * |
|
| 112 | + * @param string $message |
|
| 113 | + * |
|
| 114 | + * @return void |
|
| 115 | + */ |
|
| 116 | + public function warning(string $message) |
|
| 117 | + { |
|
| 118 | + $this->commandline($message, 'warning'); |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * Writes a string formatting for error output. |
|
| 123 | - * |
|
| 124 | - * @param string $message |
|
| 125 | - * |
|
| 126 | - * @return void |
|
| 127 | - */ |
|
| 128 | - public function error(string $message) |
|
| 129 | - { |
|
| 130 | - $this->commandline($message, 'error'); |
|
| 131 | - } |
|
| 121 | + /** |
|
| 122 | + * Writes a string formatting for error output. |
|
| 123 | + * |
|
| 124 | + * @param string $message |
|
| 125 | + * |
|
| 126 | + * @return void |
|
| 127 | + */ |
|
| 128 | + public function error(string $message) |
|
| 129 | + { |
|
| 130 | + $this->commandline($message, 'error'); |
|
| 131 | + } |
|
| 132 | 132 | |
| 133 | - /** |
|
| 134 | - * Writes a string formatting for stantard output. |
|
| 135 | - * |
|
| 136 | - * @param string $message |
|
| 137 | - * @param string|null $style |
|
| 138 | - * |
|
| 139 | - * @return void |
|
| 140 | - */ |
|
| 141 | - public function commandline(string $message, string $style = null) |
|
| 142 | - { |
|
| 143 | - $styled = $style ? "<$style>$message</>" : $message; |
|
| 133 | + /** |
|
| 134 | + * Writes a string formatting for stantard output. |
|
| 135 | + * |
|
| 136 | + * @param string $message |
|
| 137 | + * @param string|null $style |
|
| 138 | + * |
|
| 139 | + * @return void |
|
| 140 | + */ |
|
| 141 | + public function commandline(string $message, string $style = null) |
|
| 142 | + { |
|
| 143 | + $styled = $style ? "<$style>$message</>" : $message; |
|
| 144 | 144 | |
| 145 | - return $this->writeln($styled); |
|
| 146 | - } |
|
| 145 | + return $this->writeln($styled); |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | - /** |
|
| 149 | - * Outputs series of minus characters to CLI output, specified as a visual separator. |
|
| 150 | - * |
|
| 151 | - * @param int $newlines Number of lines to output, defaults to 0 |
|
| 152 | - * @param int $width Width of the line, default to 79 |
|
| 153 | - * |
|
| 154 | - * @return string |
|
| 155 | - */ |
|
| 156 | - public function hr(int $newlines = 0, $width = 79) |
|
| 157 | - { |
|
| 158 | - $this->writeln('', $newlines); |
|
| 159 | - $this->writeln(str_repeat('-', $width)); |
|
| 160 | - $this->write('', $newlines); |
|
| 161 | - } |
|
| 148 | + /** |
|
| 149 | + * Outputs series of minus characters to CLI output, specified as a visual separator. |
|
| 150 | + * |
|
| 151 | + * @param int $newlines Number of lines to output, defaults to 0 |
|
| 152 | + * @param int $width Width of the line, default to 79 |
|
| 153 | + * |
|
| 154 | + * @return string |
|
| 155 | + */ |
|
| 156 | + public function hr(int $newlines = 0, $width = 79) |
|
| 157 | + { |
|
| 158 | + $this->writeln('', $newlines); |
|
| 159 | + $this->writeln(str_repeat('-', $width)); |
|
| 160 | + $this->write('', $newlines); |
|
| 161 | + } |
|
| 162 | 162 | } |
| 163 | 163 | \ No newline at end of file |