@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->renderVars['file'] = $this->getRenderedFile($options, $this->renderVars['view'], 'tpl'); |
62 | 62 | |
63 | 63 | $layout = $this->layout; |
64 | - if (! empty($layout)) { |
|
64 | + if (!empty($layout)) { |
|
65 | 65 | if (empty(pathinfo($layout, PATHINFO_EXTENSION))) { |
66 | 66 | $layout .= '.tpl'; |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->engine->assign($this->data); |
72 | 72 | |
73 | 73 | // Doit-on mettre en cache? |
74 | - if (! empty($this->renderVars['options']['cache_name']) || ! empty($this->renderVars['options']['cache'])) { |
|
74 | + if (!empty($this->renderVars['options']['cache_name']) || !empty($this->renderVars['options']['cache'])) { |
|
75 | 75 | $this->enableCache(); |
76 | 76 | $this->engine->setCacheLifetime(60 * $this->renderVars['options']['cache'] ?? 60); |
77 | 77 | $this->engine->setCompileId($this->renderVars['options']['cache_name'] ?? null); |
@@ -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 | } |
@@ -159,10 +159,10 @@ |
||
159 | 159 | */ |
160 | 160 | private array $_options = []; |
161 | 161 | |
162 | - /** |
|
163 | - * @param Console $app Application Console |
|
164 | - * @param LoggerInterface $logger Le Logger à utiliser |
|
165 | - */ |
|
162 | + /** |
|
163 | + * @param Console $app Application Console |
|
164 | + * @param LoggerInterface $logger Le Logger à utiliser |
|
165 | + */ |
|
166 | 166 | public function __construct(protected Console $app, protected LoggerInterface $logger) |
167 | 167 | { |
168 | 168 | $this->initProps(); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | */ |
66 | 66 | public function add($middlewares, array $options = []): self |
67 | 67 | { |
68 | - if (! is_array($middlewares)) { |
|
68 | + if (!is_array($middlewares)) { |
|
69 | 69 | $middlewares = [$middlewares]; |
70 | 70 | } |
71 | 71 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function alias(string $alias, callable|object|string $middleware): self |
55 | 55 | { |
56 | - return $this->aliases([$alias => $middleware]); |
|
56 | + return $this->aliases([$alias => $middleware]); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function handle(ServerRequestInterface $request): ResponseInterface |
213 | 213 | { |
214 | - if (empty($processing = $this->getMiddleware())) { |
|
215 | - return $this->response; |
|
216 | - } |
|
214 | + if (empty($processing = $this->getMiddleware())) { |
|
215 | + return $this->response; |
|
216 | + } |
|
217 | 217 | |
218 | 218 | ['middleware' => $middleware, 'options' => $options] = $processing; |
219 | 219 | |
@@ -252,12 +252,12 @@ discard block |
||
252 | 252 | private function makeMiddleware($middleware) |
253 | 253 | { |
254 | 254 | if (is_string($middleware) && array_key_exists($middleware, $this->aliases)) { |
255 | - $middleware = $this->aliases[$middleware]; |
|
255 | + $middleware = $this->aliases[$middleware]; |
|
256 | 256 | } |
257 | 257 | |
258 | - return is_string($middleware) |
|
259 | - ? Services::container()->get($middleware) |
|
260 | - : $middleware; |
|
258 | + return is_string($middleware) |
|
259 | + ? Services::container()->get($middleware) |
|
260 | + : $middleware; |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -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 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $input = $this->all(); |
88 | 88 | |
89 | 89 | foreach ($keys as $value) { |
90 | - if (! Arr::has($input, $value)) { |
|
90 | + if (!Arr::has($input, $value)) { |
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $keys = is_array($key) ? $key : func_get_args(); |
150 | 150 | |
151 | 151 | foreach ($keys as $value) { |
152 | - if (! $this->isEmptyString($value)) { |
|
152 | + if (!$this->isEmptyString($value)) { |
|
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $keys = is_array($key) ? $key : func_get_args(); |
200 | 200 | |
201 | - return ! $this->has($keys); |
|
201 | + return !$this->has($keys); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | { |
227 | 227 | $value = $this->input($key); |
228 | 228 | |
229 | - return ! is_bool($value) && ! is_array($value) && trim((string) $value) === ''; |
|
229 | + return !is_bool($value) && !is_array($value) && trim((string) $value) === ''; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | { |
247 | 247 | $input = array_replace_recursive($this->data(), $this->allFiles()); |
248 | 248 | |
249 | - if (! $keys) { |
|
249 | + if (!$keys) { |
|
250 | 250 | return $input; |
251 | 251 | } |
252 | 252 | |
@@ -341,9 +341,9 @@ discard block |
||
341 | 341 | public function enum(string $key, $enumClass) |
342 | 342 | { |
343 | 343 | if ($this->isNotFilled($key) |
344 | - || ! function_exists('enum_exists') |
|
345 | - || ! enum_exists($enumClass) |
|
346 | - || ! method_exists($enumClass, 'tryFrom')) { |
|
344 | + || !function_exists('enum_exists') |
|
345 | + || !enum_exists($enumClass) |
|
346 | + || !method_exists($enumClass, 'tryFrom')) { |
|
347 | 347 | return null; |
348 | 348 | } |
349 | 349 | |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | */ |
458 | 458 | public function hasFile(string $key): bool |
459 | 459 | { |
460 | - if (! is_array($files = $this->file($key))) { |
|
460 | + if (!is_array($files = $this->file($key))) { |
|
461 | 461 | $files = [$files]; |
462 | 462 | } |
463 | 463 |
@@ -96,7 +96,7 @@ |
||
96 | 96 | */ |
97 | 97 | public function fullUrl(): string |
98 | 98 | { |
99 | - if (! empty($query = $this->getEnv('QUERY_STRING'))) { |
|
99 | + if (!empty($query = $this->getEnv('QUERY_STRING'))) { |
|
100 | 100 | return $this->url() . '?' . $query; |
101 | 101 | } |
102 | 102 |
@@ -293,10 +293,10 @@ |
||
293 | 293 | return $this->all(); |
294 | 294 | } |
295 | 295 | |
296 | - public function getScheme(): string |
|
297 | - { |
|
298 | - return $this->getUri()->getScheme(); |
|
299 | - } |
|
296 | + public function getScheme(): string |
|
297 | + { |
|
298 | + return $this->getUri()->getScheme(); |
|
299 | + } |
|
300 | 300 | |
301 | 301 | /** |
302 | 302 | * {@inheritDoc} |
@@ -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 | } |
@@ -159,10 +159,10 @@ |
||
159 | 159 | public function setEncryption(?string $encryption): self |
160 | 160 | { |
161 | 161 | if ($encryption === static::ENCRYPTION_NONE) { |
162 | - $encryption = null; |
|
163 | - } |
|
162 | + $encryption = null; |
|
163 | + } |
|
164 | 164 | |
165 | - if (in_array($encryption, [null, static::ENCRYPTION_SSL, static::ENCRYPTION_TLS], true)) { |
|
165 | + if (in_array($encryption, [null, static::ENCRYPTION_SSL, static::ENCRYPTION_TLS], true)) { |
|
166 | 166 | $this->encryption = $encryption; |
167 | 167 | } |
168 | 168 |
@@ -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 = function ($str, $level) { |
|
35 | + $this->mailer->Debugoutput = 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): self |
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 |
@@ -164,9 +164,9 @@ |
||
164 | 164 | */ |
165 | 165 | public function setEncryption(?string $encryption): self |
166 | 166 | { |
167 | - if ($encryption === static::ENCRYPTION_NONE) { |
|
168 | - $encryption = null; |
|
169 | - } |
|
167 | + if ($encryption === static::ENCRYPTION_NONE) { |
|
168 | + $encryption = null; |
|
169 | + } |
|
170 | 170 | |
171 | 171 | if (in_array($encryption, [null, static::ENCRYPTION_SSL, static::ENCRYPTION_TLS], true)) { |
172 | 172 | $this->mailer->SMTPSecure = $encryption; |
@@ -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 | } |