Passed
Push — main ( 8b73d6...c69a6f )
by Dimitri
03:18
created
src/Http/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Http/Redirection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $route = Services::routes()->reverseRoute($route, ...$params);
52 52
 
53
-        if (! $route) {
53
+        if (!$route) {
54 54
             throw HttpException::invalidRedirectRoute($route);
55 55
         }
56 56
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             $errors = [$errors];
82 82
         }
83 83
 
84
-        if (! empty($errors)) {
84
+        if (!empty($errors)) {
85 85
             $session = Services::session();
86 86
             $_errors = $session->getFlashdata('errors') ?? [];
87 87
             $session->setFlashdata(
Please login to merge, or discard this patch.
src/Models/BaseModel.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 return $this->db->table($table);
233 233
             }
234 234
 
235
-            if (empty($builderTable) && ! empty($this->table)) {
235
+            if (empty($builderTable) && !empty($this->table)) {
236 236
                 $this->builder = $this->builder->table($this->table);
237 237
             }
238 238
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         }
241 241
 
242 242
         // S'assurer qu'on a une bonne connxion a la base de donnees
243
-        if (! $this->db instanceof ConnectionInterface) {
243
+        if (!$this->db instanceof ConnectionInterface) {
244 244
             $this->db = Database::connect($this->group);
245 245
         }
246 246
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public function create(array|object|null $data = null, bool $returnID = true)
274 274
     {
275
-        if (! empty($this->tempData['data'])) {
275
+        if (!empty($this->tempData['data'])) {
276 276
             if (empty($data)) {
277 277
                 $data = $this->tempData['data'];
278 278
             } else {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     {
316 316
         $id = $id ?: $this->primaryKeyValue;
317 317
 
318
-        if (! empty($this->tempData['data'])) {
318
+        if (!empty($this->tempData['data'])) {
319 319
             if (empty($data)) {
320 320
                 $data = $this->tempData['data'];
321 321
             } else {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             return $data->{$this->primaryKey};
434 434
         }
435 435
 
436
-        if (is_array($data) && ! empty($data[$this->primaryKey])) {
436
+        if (is_array($data) && !empty($data[$this->primaryKey])) {
437 437
             return $data[$this->primaryKey];
438 438
         }
439 439
 
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      */
447 447
     protected function shouldUpdate(array|object $data): bool
448 448
     {
449
-        return ! empty($this->idValue($data));
449
+        return !empty($this->idValue($data));
450 450
     }
451 451
 
452 452
     /**
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 
465 465
         // Convertissez toutes les instances de Date en $dateFormat approprié
466 466
         if ($properties) {
467
-            $properties = array_map(function ($value) {
467
+            $properties = array_map(function($value) {
468 468
                 if ($value instanceof Date) {
469 469
                     return $this->timeToDate($value);
470 470
                 }
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
             $properties = $data->toArray();
493 493
         } else {
494 494
             $mirror = new ReflectionClass($data);
495
-            $props  = $mirror->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED);
495
+            $props  = $mirror->getProperties(ReflectionProperty::IS_PUBLIC|ReflectionProperty::IS_PROTECTED);
496 496
 
497 497
             $properties = [];
498 498
 
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
      */
547 547
     protected function transformDataToArray(array|object|null $data, string $type): array
548 548
     {
549
-        if (! in_array($type, ['insert', 'update'], true)) {
549
+        if (!in_array($type, ['insert', 'update'], true)) {
550 550
             throw new InvalidArgumentException(sprintf('Invalid type "%s" used upon transforming data to array.', $type));
551 551
         }
552 552
 
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 
557 557
         // Si $data utilise une classe personnalisée avec des propriétés publiques ou protégées représentant
558 558
         // les éléments de la collection, nous devons les saisir sous forme de tableau.
559
-        if (is_object($data) && ! $data instanceof stdClass) {
559
+        if (is_object($data) && !$data instanceof stdClass) {
560 560
             $data = $this->objectToArray($data, $type === 'update', true);
561 561
         }
562 562
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
         }
568 568
 
569 569
         // S'il est toujours vide ici, cela signifie que $data n'a pas changé ou est un objet vide
570
-        if (! $this->allowEmptyInserts && empty($data)) {
570
+        if (!$this->allowEmptyInserts && empty($data)) {
571 571
             throw DataException::emptyDataset($type);
572 572
         }
573 573
 
Please login to merge, or discard this patch.
src/View/Adapters/AbstractAdapter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     {
71 71
         helper('assets');
72 72
 
73
-        if (! empty($viewPathLocator)) {
73
+        if (!empty($viewPathLocator)) {
74 74
             if (is_string($viewPathLocator)) {
75 75
                 $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS;
76 76
             } elseif ($viewPathLocator instanceof Locator) {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $options = (array) $options;
222 222
 
223 223
         $viewPath = $options['viewPath'] ?? $this->viewPath;
224
-        if (! empty($viewPath)) {
224
+        if (!empty($viewPath)) {
225 225
             $file = str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\'));
226 226
         } else {
227 227
             $file = $view;
@@ -229,12 +229,12 @@  discard block
 block discarded – undo
229 229
 
230 230
         $file = Helpers::ensureExt($file, $ext);
231 231
 
232
-        if (! is_file($file) && $this->locator instanceof Locator) {
232
+        if (!is_file($file) && $this->locator instanceof Locator) {
233 233
             $file = $this->locator->locateFile($view, 'Views', empty($ext) ? 'php' : $ext);
234 234
         }
235 235
 
236 236
         // locateFile renverra une chaîne vide si le fichier est introuvable.
237
-        if (! is_file($file)) {
237
+        if (!is_file($file)) {
238 238
             throw ViewException::invalidFile($view);
239 239
         }
240 240
 
Please login to merge, or discard this patch.
src/Mail/Adapters/SymfonyMailer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Mail/Adapters/PHPMailer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Mail/Adapters/AbstractAdapter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Mail/Mail.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Mail/Mailable.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.