@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * @credit <a href="https://codeigniter.com">CodeIgniter 4.2 - date_helper</a> |
| 18 | 18 | */ |
| 19 | -if (! function_exists('now')) { |
|
| 19 | +if (!function_exists('now')) { |
|
| 20 | 20 | /** |
| 21 | 21 | * Get "now" time |
| 22 | 22 | * |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -if (! function_exists('timezone_select')) { |
|
| 56 | +if (!function_exists('timezone_select')) { |
|
| 57 | 57 | /** |
| 58 | 58 | * Generates a select field of all available timezones |
| 59 | 59 | * |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | * |
| 15 | 15 | * @credit <a href="https://codeigniter.com">CodeIgniter 4.2 - number_helper</a> |
| 16 | 16 | */ |
| 17 | -if (! function_exists('number_to_size')) { |
|
| 17 | +if (!function_exists('number_to_size')) { |
|
| 18 | 18 | /** |
| 19 | 19 | * Formats a numbers as bytes, based on size, and adds the appropriate suffix |
| 20 | 20 | * |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | // ignore sub part |
| 36 | 36 | $generalLocale = $locale; |
| 37 | - if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
| 37 | + if (!empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
| 38 | 38 | $generalLocale = substr($locale, 0, $underscorePos); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | -if (! function_exists('number_to_amount')) { |
|
| 61 | +if (!function_exists('number_to_amount')) { |
|
| 62 | 62 | /** |
| 63 | 63 | * Converts numbers to a more readable representation |
| 64 | 64 | * when dealing with very large numbers (in the thousands or above), |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | // ignore sub part |
| 89 | 89 | $generalLocale = $locale; |
| 90 | - if (! empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
| 90 | + if (!empty($locale) && ($underscorePos = strpos($locale, '_'))) { |
|
| 91 | 91 | $generalLocale = substr($locale, 0, $underscorePos); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | -if (! function_exists('number_to_currency')) { |
|
| 115 | +if (!function_exists('number_to_currency')) { |
|
| 116 | 116 | function number_to_currency(float $num, string $currency, ?string $locale = null, int $fraction = 0): string |
| 117 | 117 | { |
| 118 | 118 | return format_number($num, 1, $locale, [ |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | -if (! function_exists('format_number')) { |
|
| 126 | +if (!function_exists('format_number')) { |
|
| 127 | 127 | /** |
| 128 | 128 | * A general purpose, locale-aware, number_format method. |
| 129 | 129 | * Used by all of the functions of the number_helper. |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | -if (! function_exists('number_to_roman')) { |
|
| 175 | +if (!function_exists('number_to_roman')) { |
|
| 176 | 176 | /** |
| 177 | 177 | * Convert a number to a roman numeral. |
| 178 | 178 | * |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $config = config('cache'); |
| 55 | 55 | $handler = $this->argument('driver', $config['handler']); |
| 56 | 56 | |
| 57 | - if (! array_key_exists($handler, $config['valid_handlers'])) { |
|
| 57 | + if (!array_key_exists($handler, $config['valid_handlers'])) { |
|
| 58 | 58 | $this->fail($handler . 'n\'est pas un gestionnaire de cache valide.'); |
| 59 | 59 | |
| 60 | 60 | return; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $config['handler'] = $handler; |
| 64 | 64 | $cache = Services::cache($config); |
| 65 | 65 | |
| 66 | - if (! $cache->clear()) { |
|
| 66 | + if (!$cache->clear()) { |
|
| 67 | 67 | // @codeCoverageIgnoreStart |
| 68 | 68 | $this->fail('Erreur lors de l\'effacement du cache.'); |
| 69 | 69 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | 'nom' => $key, |
| 70 | 70 | 'chemin du serveur' => clean_path($field['server_path']), |
| 71 | 71 | 'taille' => number_to_size($field['size']), |
| 72 | - 'date' => $field['date'], // @todo formatter avec Utilities\Date |
|
| 72 | + 'date' => $field['date'], // @todo formatter avec Utilities\Date |
|
| 73 | 73 | ]; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | */ |
| 307 | 307 | final protected function success(string $message, bool $badge = true, string $label = 'SUCCESS'): self |
| 308 | 308 | { |
| 309 | - if (! $badge) { |
|
| 309 | + if (!$badge) { |
|
| 310 | 310 | $this->writer->okBold($label); |
| 311 | 311 | } else { |
| 312 | 312 | $this->writer->boldWhiteBgGreen(" {$label} "); |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | final protected function warning(string $message, bool $badge = true, string $label = 'WARNING'): self |
| 322 | 322 | { |
| 323 | - if (! $badge) { |
|
| 323 | + if (!$badge) { |
|
| 324 | 324 | $this->writer->warnBold($label); |
| 325 | 325 | } else { |
| 326 | 326 | $this->writer->boldWhiteBgYellow(" {$label} "); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | final protected function info(string $message, bool $badge = true, string $label = 'INFO'): self |
| 336 | 336 | { |
| 337 | - if (! $badge) { |
|
| 337 | + if (!$badge) { |
|
| 338 | 338 | $this->writer->infoBold($label); |
| 339 | 339 | } else { |
| 340 | 340 | $this->writer->boldWhiteBgCyan(" {$label} "); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | final protected function error(string $message, bool $badge = true, string $label = 'ERROR'): self |
| 350 | 350 | { |
| 351 | - if (! $badge) { |
|
| 351 | + if (!$badge) { |
|
| 352 | 352 | $this->writer->errorBold($label); |
| 353 | 353 | } else { |
| 354 | 354 | $this->writer->boldWhiteBgRed(" {$label} "); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | final protected function json($data): self |
| 455 | 455 | { |
| 456 | - $this->write(json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), true); |
|
| 456 | + $this->write(json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), true); |
|
| 457 | 457 | |
| 458 | 458 | return $this; |
| 459 | 459 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function expectsJson(): bool |
| 33 | 33 | { |
| 34 | - return ($this->ajax() && ! $this->pjax() && $this->acceptsAnyContentType()) || $this->wantsJson(); |
|
| 34 | + return ($this->ajax() && !$this->pjax() && $this->acceptsAnyContentType()) || $this->wantsJson(); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | private function buildDsn(): string |
| 424 | 424 | { |
| 425 | - if (! empty($this->dsn)) { |
|
| 425 | + if (!empty($this->dsn)) { |
|
| 426 | 426 | return $this->dsn; |
| 427 | 427 | } |
| 428 | 428 | |
@@ -430,8 +430,8 @@ discard block |
||
| 430 | 430 | static::PROTOCOL_SMTP => "smtp://{$this->username}:{$this->password}@{$this->host}:{$this->port}", |
| 431 | 431 | static::PROTOCOL_SENDMAIL => 'sendmail://default', |
| 432 | 432 | static::PROTOCOL_MAIL => 'sendmail://default', |
| 433 | - static::PROTOCOL_POSTMARK => "postmark+smtp://{$this->username}@default", // username joue le role de ID |
|
| 434 | - static::PROTOCOL_SENDGRID => "sendgrid+smtp://apikey:{$this->username}@default", // username joue le role de API_KEY |
|
| 433 | + static::PROTOCOL_POSTMARK => "postmark+smtp://{$this->username}@default", // username joue le role de ID |
|
| 434 | + static::PROTOCOL_SENDGRID => "sendgrid+smtp://apikey:{$this->username}@default", // username joue le role de API_KEY |
|
| 435 | 435 | default => "{$this->protocol}+smtp://{$this->username}:{$this->password}@default", |
| 436 | 436 | }; |
| 437 | 437 | } |
@@ -40,11 +40,11 @@ |
||
| 40 | 40 | if (empty($dependency['class']) || empty($dependency['package'])) { |
| 41 | 41 | throw new InvalidArgumentException('Invalid dependencies property'); |
| 42 | 42 | } |
| 43 | - if (! is_string($dependency['class']) || ! is_string($dependency['package'])) { |
|
| 43 | + if (!is_string($dependency['class']) || !is_string($dependency['package'])) { |
|
| 44 | 44 | throw new InvalidArgumentException('Invalid dependencies property'); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if (! class_exists($dependency['class'])) { |
|
| 47 | + if (!class_exists($dependency['class'])) { |
|
| 48 | 48 | throw new RuntimeException(lang('Mail.dependancyNotFound', [$dependency['class'], static::class, $dependency['package']])); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | public function send(Mail $mail): bool |
| 174 | 174 | { |
| 175 | 175 | foreach ($this->bcc() as $key => $value) { |
| 176 | - if (empty($value) || ! is_string($value)) { |
|
| 176 | + if (empty($value) || !is_string($value)) { |
|
| 177 | 177 | continue; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | foreach ($this->cc() as $key => $value) { |
| 188 | - if (empty($value) || ! is_string($value)) { |
|
| 188 | + if (empty($value) || !is_string($value)) { |
|
| 189 | 189 | continue; |
| 190 | 190 | } |
| 191 | 191 | |
@@ -198,12 +198,12 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | $content = $this->content(); |
| 200 | 200 | |
| 201 | - if (! empty($content['view'])) { |
|
| 201 | + if (!empty($content['view'])) { |
|
| 202 | 202 | $mail->view($content['view'], $this->data()); |
| 203 | - } elseif (! empty($content['html'])) { |
|
| 203 | + } elseif (!empty($content['html'])) { |
|
| 204 | 204 | $mail->html($content['html']); |
| 205 | 205 | } |
| 206 | - if (! empty($content['text'])) { |
|
| 206 | + if (!empty($content['text'])) { |
|
| 207 | 207 | $mail->text($content['text']); |
| 208 | 208 | } |
| 209 | 209 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $mail->priority($this->priority()); |
| 213 | 213 | |
| 214 | 214 | foreach ($this->replyTo() as $key => $value) { |
| 215 | - if (empty($value) || ! is_string($value)) { |
|
| 215 | + if (empty($value) || !is_string($value)) { |
|
| 216 | 216 | continue; |
| 217 | 217 | } |
| 218 | 218 | |