@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | |
| 159 | 159 | foreach ($options as $key => $value) { |
| 160 | 160 | $key = preg_replace('/^\-\-/', '', $key); |
| 161 | - if (! isset($options[$key])) { |
|
| 161 | + if (!isset($options[$key])) { |
|
| 162 | 162 | $options[$key] = $value; |
| 163 | 163 | } |
| 164 | 164 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function commandExists(string $commandName): bool |
| 173 | 173 | { |
| 174 | - return ! empty($this->_commands[$commandName]); |
|
| 174 | + return !empty($this->_commands[$commandName]); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | foreach ($files as $file) { |
| 207 | 207 | $className = $locator->findQualifiedNameFromPath($file); |
| 208 | 208 | |
| 209 | - if ($className === false || ! class_exists($className)) { |
|
| 209 | + if ($className === false || !class_exists($className)) { |
|
| 210 | 210 | continue; |
| 211 | 211 | } |
| 212 | 212 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $class = new ReflectionClass($className); |
| 233 | 233 | $logger = $logger ?: Services::logger(); |
| 234 | 234 | |
| 235 | - if (! $class->isInstantiable() || ! $class->isSubclassOf(Command::class)) { |
|
| 235 | + if (!$class->isInstantiable() || !$class->isSubclassOf(Command::class)) { |
|
| 236 | 236 | throw CLIException::invalidCommand($className); |
| 237 | 237 | } |
| 238 | 238 | |
@@ -259,13 +259,13 @@ discard block |
||
| 259 | 259 | $value = (array) $value; |
| 260 | 260 | |
| 261 | 261 | $description = $value[0]; |
| 262 | - if (! is_string($description)) { |
|
| 262 | + if (!is_string($description)) { |
|
| 263 | 263 | continue; |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | $default = $value[1] ?? null; |
| 267 | 267 | $filter = $value[2] ?? null; |
| 268 | - if ($filter !== null && ! is_callable($filter)) { |
|
| 268 | + if ($filter !== null && !is_callable($filter)) { |
|
| 269 | 269 | $filter = null; |
| 270 | 270 | } |
| 271 | 271 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $value = (array) $value; |
| 278 | 278 | |
| 279 | 279 | $description = $value[0]; |
| 280 | - if (! is_string($description)) { |
|
| 280 | + if (!is_string($description)) { |
|
| 281 | 281 | continue; |
| 282 | 282 | } |
| 283 | 283 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | $console = $this; |
| 290 | - $action = function (?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
| 290 | + $action = function(?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
| 291 | 291 | $this->name(); // ne pas retirer. car en cas, d'absence, cs-fixer mettra cette fonction en static. Et php-cli generera une erreur |
| 292 | 292 | |
| 293 | 293 | foreach ($instance->required as $package) { |
@@ -298,9 +298,9 @@ discard block |
||
| 298 | 298 | /** @var Interactor $io */ |
| 299 | 299 | $io = $console->io(); |
| 300 | 300 | |
| 301 | - if (! InstalledVersions::isInstalled($package)) { |
|
| 301 | + if (!InstalledVersions::isInstalled($package)) { |
|
| 302 | 302 | $io->info('Cette commande nécessite le package "' . $package . '" mais vous ne l\'avez pas', true); |
| 303 | - if (! $io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
| 303 | + if (!$io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
| 304 | 304 | return; |
| 305 | 305 | } |
| 306 | 306 | |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | $suppress = $suppress ?: $console->suppress; |
| 319 | - if (! $suppress) { |
|
| 319 | + if (!$suppress) { |
|
| 320 | 320 | $console->start($instance); |
| 321 | 321 | } |
| 322 | 322 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | $result = $instance->setOptions($options)->setArguments($arguments)->execute($parameters); |
| 333 | 333 | |
| 334 | - if (! $suppress) { |
|
| 334 | + if (!$suppress) { |
|
| 335 | 335 | $console->end(); |
| 336 | 336 | } |
| 337 | 337 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | private function registerException(Logger $logger) |
| 348 | 348 | { |
| 349 | - $this->onException(static function (Throwable $e, int $exitCode) use ($logger): void { |
|
| 349 | + $this->onException(static function(Throwable $e, int $exitCode) use ($logger): void { |
|
| 350 | 350 | $logger->error((string) $e, ['exitCode' => $exitCode, 'klinge' => true]); |
| 351 | 351 | }); |
| 352 | 352 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | $sortByHandler = $this->option('h', false); |
| 63 | 63 | $host = $this->option('host'); |
| 64 | 64 | |
| 65 | - if ($host) { |
|
| 65 | + if ($host) { |
|
| 66 | 66 | putenv('HTTP_HOST=' . $host); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $host = $this->option('host'); |
| 64 | 64 | |
| 65 | 65 | if ($host) { |
| 66 | - putenv('HTTP_HOST=' . $host); |
|
| 66 | + putenv('HTTP_HOST=' . $host); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $collection = Services::routes()->loadRoutes(); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function get(string $method, string $uri): array |
| 37 | 37 | { |
| 38 | - if ($method === 'CLI') { |
|
| 38 | + if ($method === 'CLI') { |
|
| 39 | 39 | return []; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -119,12 +119,12 @@ |
||
| 119 | 119 | foreach ($config->psr4 as $ns => $paths) { |
| 120 | 120 | foreach ((array) $paths as $path) { |
| 121 | 121 | if (null !== $this->option('r')) { |
| 122 | - $pathOutput = $this->truncate($path, $maxLength); |
|
| 123 | - } else { |
|
| 124 | - $pathOutput = $this->truncate(clean_path($path), $maxLength); |
|
| 125 | - } |
|
| 122 | + $pathOutput = $this->truncate($path, $maxLength); |
|
| 123 | + } else { |
|
| 124 | + $pathOutput = $this->truncate(clean_path($path), $maxLength); |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - $path = realpath($path) ?: $path; |
|
| 127 | + $path = realpath($path) ?: $path; |
|
| 128 | 128 | |
| 129 | 129 | $tbody[] = [ |
| 130 | 130 | $ns, |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | return; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - $env = strtolower($env); |
|
| 69 | + $env = strtolower($env); |
|
| 70 | 70 | |
| 71 | 71 | if ($env === 'testing') { |
| 72 | 72 | $this->fail('L\'environnement « test » est réservé aux tests PHPUnit ou Kahlan.'); |