@@ -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 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | protected function factory(): AbstractAdapter |
113 | 113 | { |
114 | - if (! empty($this->adapter)) { |
|
114 | + if (!empty($this->adapter)) { |
|
115 | 115 | return $this->adapter; |
116 | 116 | } |
117 | 117 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $handler = static::$validHandlers[$handler]; |
126 | 126 | } |
127 | 127 | |
128 | - if (! class_exists($handler)) { |
|
128 | + if (!class_exists($handler)) { |
|
129 | 129 | throw new InvalidArgumentException(lang('Mail.invalidHandler', [$handler])); |
130 | 130 | } |
131 | 131 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $debug = on_dev(); |
135 | 135 | } |
136 | 136 | |
137 | - if (! is_subclass_of($handler, AbstractAdapter::class)) { |
|
137 | + if (!is_subclass_of($handler, AbstractAdapter::class)) { |
|
138 | 138 | throw new InvalidArgumentException(lang('Mail.handlerMustExtendClass', [$handler, AbstractAdapter::class])); |
139 | 139 | } |
140 | 140 | |
@@ -342,13 +342,13 @@ discard block |
||
342 | 342 | // N'est-il pas namespaced ? on cherche le dossier en fonction du parametre "view_base" |
343 | 343 | if (strpos($view, '\\') === false) { |
344 | 344 | $path = $this->config['view_dir'] ?? ''; |
345 | - if (! empty($path)) { |
|
345 | + if (!empty($path)) { |
|
346 | 346 | $path .= '/'; |
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | 350 | $view = view($path . $view, $data); |
351 | - if (! empty($this->config['template'])) { |
|
351 | + if (!empty($this->config['template'])) { |
|
352 | 352 | $view->setLayout($this->config['template']); |
353 | 353 | } |
354 | 354 |
@@ -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 |
@@ -53,15 +53,15 @@ |
||
53 | 53 | |
54 | 54 | $viewer->setData($data)->setOptions($options); |
55 | 55 | |
56 | - if (! empty($this->layout) && is_string($this->layout)) { |
|
56 | + if (!empty($this->layout) && is_string($this->layout)) { |
|
57 | 57 | $viewer->setLayout($this->layout); |
58 | 58 | } |
59 | 59 | |
60 | - if (! empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
60 | + if (!empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
61 | 61 | $viewer->addData($this->viewDatas); |
62 | 62 | } |
63 | 63 | |
64 | - if (! is_string($controllerName = Dispatcher::getController(false))) { |
|
64 | + if (!is_string($controllerName = Dispatcher::getController(false))) { |
|
65 | 65 | $controllerName = static::class; |
66 | 66 | } |
67 | 67 |