@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | helper('filesystem'); |
42 | 42 | |
43 | - if (! delete_files(FRAMEWORK_STORAGE_PATH . 'debugbar')) { |
|
43 | + if (!delete_files(FRAMEWORK_STORAGE_PATH . 'debugbar')) { |
|
44 | 44 | // @codeCoverageIgnoreStart |
45 | 45 | $this->error('Erreur lors de la suppression des fichiers de la debugbar.')->eol(); |
46 | 46 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | public static function setUpBeforeClass(): void |
26 | 26 | { |
27 | - if (! is_dir($dirname = pathinfo(static::$ou, PATHINFO_DIRNAME))) { |
|
27 | + if (!is_dir($dirname = pathinfo(static::$ou, PATHINFO_DIRNAME))) { |
|
28 | 28 | mkdir($dirname, 0o777, true); |
29 | 29 | } |
30 | 30 |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'Sodium' => extension_loaded('sodium') && version_compare(SODIUM_LIBRARY_VERSION, '1.0.14', '>='), |
83 | 83 | ]; |
84 | 84 | |
85 | - if (! in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && ! $this->handlers[$this->driver])) { |
|
85 | + if (!in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && !$this->handlers[$this->driver])) { |
|
86 | 86 | throw EncryptionException::noHandlerAvailable($this->driver); |
87 | 87 | } |
88 | 88 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | throw EncryptionException::noDriverRequested(); |
121 | 121 | } |
122 | 122 | |
123 | - if (! in_array($this->driver, $this->drivers, true)) { |
|
123 | + if (!in_array($this->driver, $this->drivers, true)) { |
|
124 | 124 | throw EncryptionException::unKnownHandler($this->driver); |
125 | 125 | } |
126 | 126 |
@@ -125,7 +125,7 @@ |
||
125 | 125 | $data = self::substr($data, $hmacLength); |
126 | 126 | $hmacCalc = \hash_hmac($this->digest, $data, $authKey, $this->rawData); |
127 | 127 | |
128 | - if (! hash_equals($hmacKey, $hmacCalc)) { |
|
128 | + if (!hash_equals($hmacKey, $hmacCalc)) { |
|
129 | 129 | throw EncryptionException::authenticationFailed(); |
130 | 130 | } |
131 | 131 |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | foreach ($options as $key => $value) { |
159 | 159 | $key = preg_replace('/^\-\-/', '', $key); |
160 | - if (! isset($options[$key])) { |
|
160 | + if (!isset($options[$key])) { |
|
161 | 161 | $options[$key] = $value; |
162 | 162 | } |
163 | 163 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | foreach ($files as $file) { |
198 | 198 | $className = $locator->findQualifiedNameFromPath($file); |
199 | 199 | |
200 | - if ($className === false || ! class_exists($className)) { |
|
200 | + if ($className === false || !class_exists($className)) { |
|
201 | 201 | continue; |
202 | 202 | } |
203 | 203 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $class = new ReflectionClass($className); |
224 | 224 | $logger = $logger ?: Services::logger(); |
225 | 225 | |
226 | - if (! $class->isInstantiable() || ! $class->isSubclassOf(Command::class)) { |
|
226 | + if (!$class->isInstantiable() || !$class->isSubclassOf(Command::class)) { |
|
227 | 227 | throw CLIException::invalidCommand($className); |
228 | 228 | } |
229 | 229 | |
@@ -250,13 +250,13 @@ discard block |
||
250 | 250 | $value = (array) $value; |
251 | 251 | |
252 | 252 | $description = $value[0]; |
253 | - if (! is_string($description)) { |
|
253 | + if (!is_string($description)) { |
|
254 | 254 | continue; |
255 | 255 | } |
256 | 256 | |
257 | 257 | $default = $value[1] ?? null; |
258 | 258 | $filter = $value[2] ?? null; |
259 | - if ($filter !== null && ! is_callable($filter)) { |
|
259 | + if ($filter !== null && !is_callable($filter)) { |
|
260 | 260 | $filter = null; |
261 | 261 | } |
262 | 262 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | $value = (array) $value; |
269 | 269 | |
270 | 270 | $description = $value[0]; |
271 | - if (! is_string($description)) { |
|
271 | + if (!is_string($description)) { |
|
272 | 272 | continue; |
273 | 273 | } |
274 | 274 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | |
280 | 280 | $console = $this; |
281 | - $action = function (?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
281 | + $action = function(?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
282 | 282 | foreach ($instance->required as $package) { |
283 | 283 | $package = explode(':', $package); |
284 | 284 | $version = $package[1] ?? null; |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | /** @var \Ahc\Cli\IO\Interactor $io */ |
288 | 288 | $io = $this->io(); |
289 | 289 | |
290 | - if (! InstalledVersions::isInstalled($package)) { |
|
290 | + if (!InstalledVersions::isInstalled($package)) { |
|
291 | 291 | $io->info('Cette commande nécessite le package "' . $package . '" mais vous ne l\'avez pas', true); |
292 | - if (! $io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
292 | + if (!$io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
293 | 293 | return; |
294 | 294 | } |
295 | 295 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | $suppress = $suppress ?: $console->suppress; |
308 | - if (! $suppress) { |
|
308 | + if (!$suppress) { |
|
309 | 309 | $console->start($instance->service); |
310 | 310 | } |
311 | 311 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | |
321 | 321 | $result = $instance->setOptions($options)->setArguments($arguments)->execute($parameters); |
322 | 322 | |
323 | - if (! $suppress) { |
|
323 | + if (!$suppress) { |
|
324 | 324 | $console->end(); |
325 | 325 | } |
326 | 326 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | |
336 | 336 | private function registerException(Logger $logger) |
337 | 337 | { |
338 | - $this->onException(static function (Throwable $e, int $exitCode) use ($logger) { |
|
338 | + $this->onException(static function(Throwable $e, int $exitCode) use ($logger) { |
|
339 | 339 | $logger->error((string) $e, ['exitCode' => $exitCode, 'klinge' => true]); |
340 | 340 | |
341 | 341 | throw new CLIException($e->getMessage(), $exitCode, $e); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct(bool $debug = false) |
33 | 33 | { |
34 | 34 | $this->mailer = new Mailer(); |
35 | - $this->mailer->Debugoutput = static function ($str, $level) { |
|
35 | + $this->mailer->Debugoutput = static function($str, $level) { |
|
36 | 36 | Services::logger()->info('[Mail][' . $level . ']: ' . $str); |
37 | 37 | }; |
38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function init(array $config): static |
46 | 46 | { |
47 | - if (! empty($config['username']) && ! empty($config['password'])) { |
|
47 | + if (!empty($config['username']) && !empty($config['password'])) { |
|
48 | 48 | $this->mailer->SMTPAuth = true; |
49 | 49 | } |
50 | 50 |
@@ -11,10 +11,13 @@ discard block |
||
11 | 11 | use Psr\Http\Server\RequestHandlerInterface; |
12 | 12 | |
13 | 13 | class {class} extends BaseMiddleware implements MiddlewareInterface |
14 | -<?php else: ?> |
|
14 | +<?php else { |
|
15 | + : ?> |
|
15 | 16 | |
16 | 17 | class {class} extends BaseMiddleware |
17 | -<?php endif; ?> |
|
18 | +<?php endif; |
|
19 | +} |
|
20 | +?> |
|
18 | 21 | { |
19 | 22 | /** |
20 | 23 | * Traitez une demande de serveur entrante. |
@@ -26,16 +29,22 @@ discard block |
||
26 | 29 | */ |
27 | 30 | <?php if ($standard === 'psr15'): ?> |
28 | 31 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
29 | -<?php else: ?> |
|
32 | +<?php else { |
|
33 | + : ?> |
|
30 | 34 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface |
31 | -<?php endif; ?> |
|
35 | +<?php endif; |
|
36 | +} |
|
37 | +?> |
|
32 | 38 | { |
33 | 39 | // |
34 | 40 | |
35 | 41 | <?php if ($standard === 'psr15'): ?> |
36 | 42 | return $handler->handle($request); |
37 | -<?php else: ?> |
|
43 | +<?php else { |
|
44 | + : ?> |
|
38 | 45 | return $next($request, $response); |
39 | -<?php endif; ?> |
|
46 | +<?php endif; |
|
47 | +} |
|
48 | +?> |
|
40 | 49 | } |
41 | 50 | } |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | $standard = $this->option('standard', 'psr15'); |
80 | 80 | |
81 | - if (! in_array($standard, ['psr15', 'psr7'], true)) { |
|
81 | + if (!in_array($standard, ['psr15', 'psr7'], true)) { |
|
82 | 82 | // @codeCoverageIgnoreStart |
83 | 83 | $standard = $this->choice(lang('CLI.generator.middlewareStandard'), ['psr15', 'psr7'], 'psr15'); |
84 | 84 | $this->eol(); |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public static function registerHttpErrors(Run $debugger, array $config): Run |
37 | 37 | { |
38 | - return $debugger->pushHandler(static function (Throwable $exception, InspectorInterface $inspector, RunInterface $run) use ($config) { |
|
38 | + return $debugger->pushHandler(static function(Throwable $exception, InspectorInterface $inspector, RunInterface $run) use ($config) { |
|
39 | 39 | if (true === $config['log']) { |
40 | - if (! in_array($exception->getCode(), $config['ignore_codes'], true)) { |
|
40 | + if (!in_array($exception->getCode(), $config['ignore_codes'], true)) { |
|
41 | 41 | Services::logger()->error($exception); |
42 | 42 | } |
43 | 43 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $debugger->pushHandler(new PlainTextHandler()); |
91 | 91 | } |
92 | 92 | |
93 | - if (! is_online()) { |
|
93 | + if (!is_online()) { |
|
94 | 94 | if (Misc::isAjaxRequest() || Services::request()->isJson()) { |
95 | 95 | $debugger->pushHandler(new JsonResponseHandler()); |
96 | 96 | } else { |