@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $class = $this->translateURI($segment); |
162 | 162 | |
163 | 163 | // dès que nous rencontrons un segment qui n'est pas compatible PSR-4, arrêter la recherche |
164 | - if (! $this->isValidSegment($class)) { |
|
164 | + if (!$this->isValidSegment($class)) { |
|
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | throw new MethodNotFoundException(); |
388 | 388 | } |
389 | 389 | |
390 | - if (! $refMethod->isPublic()) { |
|
390 | + if (!$refMethod->isPublic()) { |
|
391 | 391 | throw new MethodNotFoundException(); |
392 | 392 | } |
393 | 393 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | return; |
450 | 450 | } |
451 | 451 | |
452 | - if (! in_array(ltrim($classname, '\\'), get_declared_classes(), true)) { |
|
452 | + if (!in_array(ltrim($classname, '\\'), get_declared_classes(), true)) { |
|
453 | 453 | throw new PageNotFoundException( |
454 | 454 | '"' . $classname . '" n\'a pas été trouvé.' |
455 | 455 | ); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | // Mais si un visiteur navigue vers l'URI `controller/somemethod`, `getSomemethod()` sera vérifié, et `method_exists()` retournera true parce que les noms de méthodes en PHP sont insensibles à la casse. |
474 | 474 | method_exists($this->controller, $method) |
475 | 475 | // Mais nous n'autorisons pas `controller/somemethod`, donc vérifiez le nom exact de la méthode. |
476 | - && ! in_array($method, get_class_methods($this->controller), true) |
|
476 | + && !in_array($method, get_class_methods($this->controller), true) |
|
477 | 477 | ) { |
478 | 478 | throw new PageNotFoundException( |
479 | 479 | '"' . $this->controller . '::' . $method . '()" n\'a pas été trouvé.' |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | */ |
579 | 579 | public function directory(): string |
580 | 580 | { |
581 | - return ! empty($this->directory) ? $this->directory : ''; |
|
581 | + return !empty($this->directory) ? $this->directory : ''; |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
17 | 17 | |
18 | 18 | // Se rassurer que le dossier courant pointe sur le dossier du front controller |
19 | -if (! defined('TEST_PATH')) { |
|
19 | +if (!defined('TEST_PATH')) { |
|
20 | 20 | // On doit aussi verifier qu'on n'est pas en phase de test, sinon khalan ne trouvera pas le dossier des specs |
21 | 21 | chdir(WEBROOT); |
22 | 22 | } |
23 | 23 | |
24 | -return function (array $paths, string $paths_config_file, bool $is_cli): void { |
|
24 | +return function(array $paths, string $paths_config_file, bool $is_cli): void { |
|
25 | 25 | // Le chemin d'accès vers le dossier de l'application |
26 | 26 | if (is_dir($paths['app'])) { |
27 | 27 | if (($_temp = realpath($paths['app'])) !== false) { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $app = new Application(); |
105 | 105 | $app->init(); |
106 | 106 | |
107 | - if (! $is_cli) { |
|
107 | + if (!$is_cli) { |
|
108 | 108 | $app->run(); |
109 | 109 | } |
110 | 110 | }; |
@@ -434,8 +434,8 @@ |
||
434 | 434 | static::PROTOCOL_SMTP => "smtp://{$this->username}:{$this->password}@{$this->host}:{$this->port}", |
435 | 435 | static::PROTOCOL_SENDMAIL => 'sendmail://default', |
436 | 436 | static::PROTOCOL_MAIL => 'sendmail://default', |
437 | - static::PROTOCOL_POSTMARK => "postmark+smtp://{$this->username}@default", // username joue le role de ID |
|
438 | - static::PROTOCOL_SENDGRID => "sendgrid+smtp://apikey:{$this->username}@default", // username joue le role de API_KEY |
|
437 | + static::PROTOCOL_POSTMARK => "postmark+smtp://{$this->username}@default", // username joue le role de ID |
|
438 | + static::PROTOCOL_SENDGRID => "sendgrid+smtp://apikey:{$this->username}@default", // username joue le role de API_KEY |
|
439 | 439 | default => "{$this->protocol}+smtp://{$this->username}:{$this->password}@default", |
440 | 440 | }; |
441 | 441 | } |
@@ -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): void { |
|
35 | + $this->mailer->Debugoutput = static function($str, $level): void { |
|
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 |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $handler = static::$validHandlers[$handler]; |
127 | 127 | } |
128 | 128 | |
129 | - if (! class_exists($handler)) { |
|
129 | + if (!class_exists($handler)) { |
|
130 | 130 | throw new InvalidArgumentException(lang('Mail.invalidHandler', [$handler])); |
131 | 131 | } |
132 | 132 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $debug = on_dev(); |
136 | 136 | } |
137 | 137 | |
138 | - if (! is_subclass_of($handler, AbstractAdapter::class)) { |
|
138 | + if (!is_subclass_of($handler, AbstractAdapter::class)) { |
|
139 | 139 | throw new InvalidArgumentException(lang('Mail.handlerMustExtendClass', [$handler, AbstractAdapter::class])); |
140 | 140 | } |
141 | 141 | |
@@ -341,15 +341,15 @@ discard block |
||
341 | 341 | $path = ''; |
342 | 342 | |
343 | 343 | // N'est-il pas namespaced ? on cherche le dossier en fonction du parametre "view_base" |
344 | - if (! str_contains($view, '\\')) { |
|
344 | + if (!str_contains($view, '\\')) { |
|
345 | 345 | $path = $this->config['view_dir'] ?? ''; |
346 | - if (! empty($path)) { |
|
346 | + if (!empty($path)) { |
|
347 | 347 | $path .= '/'; |
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
351 | 351 | $view = view($path . $view, $data); |
352 | - if (! empty($this->config['template'])) { |
|
352 | + if (!empty($this->config['template'])) { |
|
353 | 353 | $view->layout($this->config['template']); |
354 | 354 | } |
355 | 355 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | ->requireDirectory(APP_PATH, Checker::CHECK_IS_READABLE); |
96 | 96 | |
97 | 97 | $checker->check(); |
98 | - if (! $checker->isSatisfied()) { |
|
98 | + if (!$checker->isSatisfied()) { |
|
99 | 99 | echo '<h3>An error encourred</h3>'; |
100 | 100 | |
101 | 101 | exit(implode('<br/> ', $checker->getErrors())); |
@@ -308,14 +308,14 @@ |
||
308 | 308 | */ |
309 | 309 | private function setFormatter(object $handler, array $allowed, ?string $format = 'json'): object |
310 | 310 | { |
311 | - if (! method_exists($handler, 'setFormatter')) { |
|
311 | + if (!method_exists($handler, 'setFormatter')) { |
|
312 | 312 | return $handler; |
313 | 313 | } |
314 | 314 | |
315 | 315 | if ($format === null || $format === '') { |
316 | 316 | $format = 'json'; |
317 | 317 | } |
318 | - if ($allowed !== [] && ! in_array($format, $allowed, true)) { |
|
318 | + if ($allowed !== [] && !in_array($format, $allowed, true)) { |
|
319 | 319 | throw new InvalidArgumentException('Invalid formatter for log file handler. Accepts values: ' . implode('/', $allowed)); |
320 | 320 | } |
321 | 321 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $this->config = $config ?? (object) config('toolbar'); |
68 | 68 | |
69 | 69 | foreach ($this->config->collectors as $collector) { |
70 | - if (! class_exists($collector)) { |
|
70 | + if (!class_exists($collector)) { |
|
71 | 71 | logger()->critical( |
72 | 72 | 'Toolbar collector does not exist (' . $collector . ').' |
73 | 73 | . ' Please check $collectors in the app/Config/toolbar.php file.' |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | $output = ''; |
207 | 207 | |
208 | 208 | foreach ($rows as $row) { |
209 | - $hasChildren = isset($row['children']) && ! empty($row['children']); |
|
210 | - $isQuery = isset($row['query']) && ! empty($row['query']); |
|
209 | + $hasChildren = isset($row['children']) && !empty($row['children']); |
|
210 | + $isQuery = isset($row['query']) && !empty($row['query']); |
|
211 | 211 | |
212 | 212 | // Ouvrir la chronologie du contrôleur par défaut |
213 | 213 | $open = $row['name'] === 'Controller'; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | // Le collecter |
274 | 274 | foreach ($collectors as $collector) { |
275 | - if (! $collector['hasTimelineData']) { |
|
275 | + if (!$collector['hasTimelineData']) { |
|
276 | 276 | continue; |
277 | 277 | } |
278 | 278 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | array_multisort(...$sortArray); |
290 | 290 | |
291 | 291 | // Ajouter une heure de fin à chaque élément |
292 | - array_walk($data, static function (&$row): void { |
|
292 | + array_walk($data, static function(&$row): void { |
|
293 | 293 | $row['end'] = $row['start'] + $row['duration']; |
294 | 294 | }); |
295 | 295 | |
@@ -332,14 +332,14 @@ discard block |
||
332 | 332 | */ |
333 | 333 | protected function collectVarData(): array |
334 | 334 | { |
335 | - if (! ($this->config->collectVarData ?? true)) { |
|
335 | + if (!($this->config->collectVarData ?? true)) { |
|
336 | 336 | return []; |
337 | 337 | } |
338 | 338 | |
339 | 339 | $data = []; |
340 | 340 | |
341 | 341 | foreach ($this->collectors as $collector) { |
342 | - if (! $collector->hasVarData()) { |
|
342 | + if (!$collector->hasVarData()) { |
|
343 | 343 | continue; |
344 | 344 | } |
345 | 345 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | |
376 | 376 | // Si on a desactiver le debogage ou l'affichage de la debugbar, on s'arrete |
377 | - if (! BLITZ_DEBUG || ! $this->config->show_debugbar) { |
|
377 | + if (!BLITZ_DEBUG || !$this->config->show_debugbar) { |
|
378 | 378 | return $response; |
379 | 379 | } |
380 | 380 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | // Mise à jour vers microtime() pour que nous puissions obtenir l'historique |
390 | 390 | $time = sprintf('%.6f', Date::now()->format('U.u')); |
391 | 391 | |
392 | - if (! is_dir($this->debugPath)) { |
|
392 | + if (!is_dir($this->debugPath)) { |
|
393 | 393 | mkdir($this->debugPath, 0o777); |
394 | 394 | } |
395 | 395 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | |
400 | 400 | // Les formats non HTML ne doivent pas inclure la barre de débogage, |
401 | 401 | // puis nous envoyons des en-têtes indiquant où trouver les données de débogage pour cette réponse |
402 | - if ($request->ajax() || ! str_contains($format, 'html')) { |
|
402 | + if ($request->ajax() || !str_contains($format, 'html')) { |
|
403 | 403 | return $response |
404 | 404 | ->withHeader('Debugbar-Time', "{$time}") |
405 | 405 | ->withHeader('Debugbar-Link', site_url("?debugbar_time={$time}")); |
@@ -35,8 +35,8 @@ 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) { |
|
39 | - if (true === $config['log'] && ! in_array($exception->getCode(), $config['ignore_codes'], true)) { |
|
38 | + return $debugger->pushHandler(static function(Throwable $exception, InspectorInterface $inspector, RunInterface $run) use ($config) { |
|
39 | + if (true === $config['log'] && !in_array($exception->getCode(), $config['ignore_codes'], true)) { |
|
40 | 40 | Services::logger()->error($exception); |
41 | 41 | } |
42 | 42 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $debugger->pushHandler(new PlainTextHandler()); |
89 | 89 | } |
90 | 90 | |
91 | - if (! is_online()) { |
|
91 | + if (!is_online()) { |
|
92 | 92 | if (Misc::isAjaxRequest() || Services::request()->isJson()) { |
93 | 93 | $debugger->pushHandler(new JsonResponseHandler()); |
94 | 94 | } else { |