Passed
Push — main ( 3399b6...dd4eea )
by Dimitri
11:50
created
src/Cli/Commands/Generators/Migration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             throw new InvalidArgumentException('Impossible d\'utiliser "create" et "modify" au même moment pour la génération des migrations.');
99 99
         }
100 100
 
101
-        if (! $create && ! $modify) {
101
+        if (!$create && !$modify) {
102 102
             $data['action'] = null;
103 103
         } else {
104 104
             $data['action'] = $create ? 'create' : 'modify';
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             }
118 118
         }
119 119
 
120
-        if (! is_string($table) || $table === '') {
120
+        if (!is_string($table) || $table === '') {
121 121
             if ($data['session']) {
122 122
                 $table = 'blitz_sessions';
123 123
             } elseif (is_string($create)) {
Please login to merge, or discard this patch.
src/Cli/Commands/Encryption/GenerateKey.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
         if (in_array($prefix, [null, true], true)) {
60 60
             $prefix = 'hex2bin';
61
-        } elseif (! in_array($prefix, ['hex2bin', 'base64'], true)) {
61
+        } elseif (!in_array($prefix, ['hex2bin', 'base64'], true)) {
62 62
             $prefix = $this->choice('Veuillez utiliser un prefixe validee.', ['hex2bin', 'base64']); // @codeCoverageIgnore
63 63
         }
64 64
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             return;
79 79
         }
80 80
 
81
-        if (! $this->setNewEncryptionKey($encodedKey)) {
81
+        if (!$this->setNewEncryptionKey($encodedKey)) {
82 82
             $this->writer->error('Erreur dans la configuration d\'une nouvelle cle d\'encryption dans le fichier `.env`.', true);
83 83
 
84 84
             return;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $currentKey = env('encryption.key', '');
110 110
 
111
-        if ($currentKey !== '' && ! $this->confirmOverwrite()) {
111
+        if ($currentKey !== '' && !$this->confirmOverwrite()) {
112 112
             // Pas testable car require une entree au clavier
113 113
             return false; // @codeCoverageIgnore
114 114
         }
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
         $baseEnv = ROOTPATH . '.env.example';
133 133
         $envFile = ROOTPATH . '.env';
134 134
 
135
-        if (! is_file($envFile)) {
136
-            if (! is_file($baseEnv)) {
135
+        if (!is_file($envFile)) {
136
+            if (!is_file($baseEnv)) {
137 137
                 $this->writer->warn('Both default shipped `.env.example` file and custom `.env` are missing.');
138 138
                 $this->write('Here\'s your new key instead: ' . $this->writer->warn($key), true);
139 139
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             $dotenv->update(['encryption.key' => $key], false);
156 156
         }
157 157
 
158
-        if (! $append) {
158
+        if (!$append) {
159 159
             return false;
160 160
         }
161 161
 
Please login to merge, or discard this patch.
src/Cli/Console/Console.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         foreach ($files as $file) {
180 180
             $className = $locator->getClassname($file);
181 181
 
182
-            if ($className === '' || ! class_exists($className)) {
182
+            if ($className === '' || !class_exists($className)) {
183 183
                 continue;
184 184
             }
185 185
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         $class  = new ReflectionClass($className);
206 206
         $logger = $logger ?: Services::logger();
207 207
 
208
-        if (! $class->isInstantiable() || ! $class->isSubclassOf(Command::class)) {
208
+        if (!$class->isInstantiable() || !$class->isSubclassOf(Command::class)) {
209 209
             throw CLIException::invalidCommand($className);
210 210
         }
211 211
 
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
             $value = (array) $value;
233 233
 
234 234
             $description = $value[0];
235
-            if (! is_string($description)) {
235
+            if (!is_string($description)) {
236 236
                 continue;
237 237
             }
238 238
 
239 239
             $default = $value[1] ?? null;
240 240
             $filter  = $value[2] ?? null;
241
-            if ($filter !== null && ! is_callable($filter)) {
241
+            if ($filter !== null && !is_callable($filter)) {
242 242
                 $filter = null;
243 243
             }
244 244
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             $value = (array) $value;
251 251
 
252 252
             $description = $value[0];
253
-            if (! is_string($description)) {
253
+            if (!is_string($description)) {
254 254
                 continue;
255 255
             }
256 256
 
@@ -260,15 +260,15 @@  discard block
 block discarded – undo
260 260
         }
261 261
 
262 262
         $console = $this;
263
-        $action  = function (?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) {
263
+        $action  = function(?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) {
264 264
             foreach ($instance->required as $package) {
265 265
                 $package = explode(':', $package);
266 266
                 $version = $package[1] ?? null;
267 267
                 $package = $package[0];
268 268
 
269
-                if (! InstalledVersions::isInstalled($package)) {
269
+                if (!InstalledVersions::isInstalled($package)) {
270 270
                     $console->io()->info('Cette commande nécessite le package "' . $package . '" mais vous ne l\'avez pas', true);
271
-                    if (! $console->io()->confirm('Voulez-vous l\'installer maintenant ?')) {
271
+                    if (!$console->io()->confirm('Voulez-vous l\'installer maintenant ?')) {
272 272
                         return;
273 273
                     }
274 274
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
             }
285 285
 
286 286
             $suppress = $suppress ?: $console->suppress;
287
-            if (! $suppress) {
287
+            if (!$suppress) {
288 288
                 $console->start($instance->service);
289 289
             }
290 290
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
             $result = $instance->setOptions($options)->setArguments($arguments)->execute($parameters);
301 301
 
302
-            if (! $suppress) {
302
+            if (!$suppress) {
303 303
                 $console->end();
304 304
             }
305 305
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
     private function registerException(Logger $logger)
316 316
     {
317
-        $this->onException(function (Throwable $e, int $exitCode) use ($logger) {
317
+        $this->onException(function(Throwable $e, int $exitCode) use ($logger) {
318 318
             $logger->error((string) $e, ['exitCode' => $exitCode, 'klinge' => true]);
319 319
 
320 320
             throw new CLIException($e->getMessage(), $exitCode, $e);
Please login to merge, or discard this patch.
src/Initializer/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 // Se rassurer que le dossier courant pointe sur le dossier du front controller
19 19
 chdir(WEBROOT);
20 20
 
21
-return function (array $paths, string $paths_config_file, bool $is_cli) {
21
+return function(array $paths, string $paths_config_file, bool $is_cli) {
22 22
     // Le chemin d'accès vers le dossier de l'application
23 23
     if (is_dir($paths['app'])) {
24 24
         if (($_temp = realpath($paths['app'])) !== false) {
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     require_once __DIR__ . DS . 'kint.php';
95 95
 
96
-    if (! $is_cli) {
96
+    if (!$is_cli) {
97 97
         $app->run();
98 98
     }
99 99
 };
Please login to merge, or discard this patch.
src/Constants/constants.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -102,35 +102,35 @@  discard block
 block discarded – undo
102 102
  */
103 103
 defined('LAYOUT_PATH') || define('LAYOUT_PATH', VIEW_PATH . 'layouts' . DS);
104 104
 
105
-if (! defined('SERVICE_PATH')) {
105
+if (!defined('SERVICE_PATH')) {
106 106
     /**
107 107
      * Services directory path
108 108
      */
109 109
     define('SERVICE_PATH', APP_PATH . 'services' . DS);
110 110
 }
111 111
 
112
-if (! defined('DATABASE_PATH')) {
112
+if (!defined('DATABASE_PATH')) {
113 113
     /**
114 114
      * Database storage directory path
115 115
      */
116 116
     define('DATABASE_PATH', STORAGE_PATH . 'database' . DS);
117 117
 }
118 118
 
119
-if (! defined('DB_SEED_PATH')) {
119
+if (!defined('DB_SEED_PATH')) {
120 120
     /**
121 121
      * Database seeds storage path
122 122
      */
123 123
     define('DB_SEED_PATH', RESOURCE_PATH . 'database' . DS . 'seeds' . DS);
124 124
 }
125 125
 
126
-if (! defined('DB_DUMP_PATH')) {
126
+if (!defined('DB_DUMP_PATH')) {
127 127
     /**
128 128
      * Database backup storage path
129 129
      */
130 130
     define('DB_DUMP_PATH', DATABASE_PATH . 'dump' . DS);
131 131
 }
132 132
 
133
-if (! defined('DB_CACHE_PATH')) {
133
+if (!defined('DB_CACHE_PATH')) {
134 134
     /**
135 135
      * Database cache directory path
136 136
      */
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
  */
153 153
 defined('SECOND') || define('SECOND', 1);
154 154
 defined('MINUTE') || define('MINUTE', 60);
155
-defined('HOUR')   || define('HOUR', 3600);
156
-defined('DAY')    || define('DAY', 86400);
157
-defined('WEEK')   || define('WEEK', 604800);
158
-defined('MONTH')  || define('MONTH', 2592000);
159
-defined('YEAR')   || define('YEAR', 31536000);
155
+defined('HOUR') || define('HOUR', 3600);
156
+defined('DAY') || define('DAY', 86400);
157
+defined('WEEK') || define('WEEK', 604800);
158
+defined('MONTH') || define('MONTH', 2592000);
159
+defined('YEAR') || define('YEAR', 31536000);
160 160
 defined('DECADE') || define('DECADE', 315360000);
161 161
 
162 162
 /**
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
  * - BSD sysexits.h: http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
178 178
  * - Bash scripting: http://tldp.org/LDP/abs/html/exitcodes.html
179 179
  */
180
-defined('EXIT_SUCCESS')        || define('EXIT_SUCCESS', 0); // pas d'erreurs
181
-defined('EXIT_ERROR')          || define('EXIT_ERROR', 1); // erreur generique
182
-defined('EXIT_CONFIG')         || define('EXIT_CONFIG', 3); // erreur de configuration
183
-defined('EXIT_UNKNOWN_FILE')   || define('EXIT_UNKNOWN_FILE', 4); // fichier non trouvé
184
-defined('EXIT_UNKNOWN_CLASS')  || define('EXIT_UNKNOWN_CLASS', 5); // classe inconnue
180
+defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // pas d'erreurs
181
+defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // erreur generique
182
+defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // erreur de configuration
183
+defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // fichier non trouvé
184
+defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // classe inconnue
185 185
 defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // membre de classe inconnu
186
-defined('EXIT_USER_INPUT')     || define('EXIT_USER_INPUT', 7); // saisie utilisateur invalide
187
-defined('EXIT_DATABASE')       || define('EXIT_DATABASE', 8); // erreur de base de données
188
-defined('EXIT__AUTO_MIN')      || define('EXIT__AUTO_MIN', 9); // code d'erreur attribué automatiquement le plus bas
189
-defined('EXIT__AUTO_MAX')      || define('EXIT__AUTO_MAX', 125); // code d'erreur attribué automatiquement le plus élevé
186
+defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // saisie utilisateur invalide
187
+defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // erreur de base de données
188
+defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // code d'erreur attribué automatiquement le plus bas
189
+defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // code d'erreur attribué automatiquement le plus élevé
Please login to merge, or discard this patch.
src/Http/UploadedFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
      */
82 82
     public function get()
83 83
     {
84
-        if (! $this->isValid()) {
84
+        if (!$this->isValid()) {
85 85
             throw new FileNotFoundException("Le fichier n'existe pas dans le chemin {$this->getPathname()}.");
86 86
         }
87 87
 
Please login to merge, or discard this patch.
src/Cli/Traits/GeneratorTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             // @codeCoverageIgnoreStart
114 114
             $this->colorize(lang('CLI.generator.usingBlitzNamespace'), 'yellow');
115 115
 
116
-            if (! $this->confirm('Are you sure you want to continue?')) {
116
+            if (!$this->confirm('Are you sure you want to continue?')) {
117 117
                 $this->eol()->colorize(lang('CLI.generator.cancelOperation'), 'yellow');
118 118
 
119 119
                 return;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
         // Écraser des fichiers sans le savoir est une gêne sérieuse, nous allons donc vérifier si nous dupliquons des choses,
129 129
         // si l'option "forcer" n'est pas fournie, nous renvoyons.
130
-        if (! $this->option('force') && $isFile) {
130
+        if (!$this->option('force') && $isFile) {
131 131
             $this->io->error(lang('CLI.generator.fileExist', [clean_path($target)]), true);
132 132
 
133 133
             return;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         // Vérifie si le répertoire pour enregistrer le fichier existe.
137 137
         $dir = dirname($target);
138 138
 
139
-        if (! is_dir($dir)) {
139
+        if (!is_dir($dir)) {
140 140
             mkdir($dir, 0755, true);
141 141
         }
142 142
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         // Construisez la classe en fonction des détails dont nous disposons.
146 146
         // Nous obtiendrons le contenu de notre fichier à partir du modèle,
147 147
         // puis nous effectuerons les remplacements nécessaires.
148
-        if (! write_file($target, $content)) {
148
+        if (!write_file($target, $content)) {
149 149
             // @codeCoverageIgnoreStart
150 150
             $this->io->error(lang('CLI.generator.fileError', [clean_path($target)]), true);
151 151
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             $class = $matches[1] . ucfirst($matches[2]);
210 210
         }
211 211
 
212
-        if ($this->enabledSuffixing && $this->getOption('suffix') && ! strripos($class, $component)) {
212
+        if ($this->enabledSuffixing && $this->getOption('suffix') && !strripos($class, $component)) {
213 213
             $class .= ucfirst($component);
214 214
         }
215 215
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
         $base = Services::autoloader()->getNamespace($namespace);
282 282
 
283
-        if (! $base = reset($base)) {
283
+        if (!$base = reset($base)) {
284 284
             $this->io->error(lang('CLI.namespaceNotDefined', [$namespace]), true);
285 285
 
286 286
             return '';
Please login to merge, or discard this patch.
src/Cli/Traits/ContentReplacer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,14 +52,14 @@
 block discarded – undo
52 52
 
53 53
         $directory = dirname($path);
54 54
 
55
-        if (! is_dir($directory)) {
55
+        if (!is_dir($directory)) {
56 56
             mkdir($directory, 0777, true);
57 57
         }
58 58
 
59 59
         if (file_exists($path)) {
60 60
             $overwrite = (bool) $this->option('f');
61 61
 
62
-            if (! $overwrite && ! $this->confirm("File '{$cleanPath}' already exists in destination. Overwrite?")) {
62
+            if (!$overwrite && !$this->confirm("File '{$cleanPath}' already exists in destination. Overwrite?")) {
63 63
                 $this->error("Skipped {$cleanPath}. If you wish to overwrite, please use the '-f' option or reply 'y' to the prompt.");
64 64
 
65 65
                 return;
Please login to merge, or discard this patch.
src/View/Adapters/NativeAdapter.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         // Enregistrer les variables actuelles
131 131
         $renderVars = $this->renderVars;
132 132
 
133
-        $output = (function (): string {
133
+        $output = (function(): string {
134 134
             extract($this->tempData);
135 135
             ob_start();
136 136
             include $this->renderVars['file'];
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
         $this->logPerformance($this->renderVars['start'], microtime(true), $this->renderVars['view']);
158 158
 
159
-        if (($this->debug && (! isset($options['debug']) || $options['debug'] === true))) {
159
+        if (($this->debug && (!isset($options['debug']) || $options['debug'] === true))) {
160 160
             // Nettoyer nos noms de chemins pour les rendre un peu plus propres
161 161
             $this->renderVars['file'] = clean_path($this->renderVars['file']);
162 162
             $this->renderVars['file'] = ++$this->viewsCount . ' ' . $this->renderVars['file'];
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         $saveData ??= $this->saveData;
186 186
         $this->prepareTemplateData($saveData);
187 187
 
188
-        $output = (function (string $view): string {
188
+        $output = (function(string $view): string {
189 189
             extract($this->tempData);
190 190
             ob_start();
191 191
             eval('?>' . $view);
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         $section = array_pop($this->sectionStack);
314 314
 
315 315
         // Assurez-vous qu'un tableau existe afin que nous puissions stocker plusieurs entrées pour cela.
316
-        if (! array_key_exists($section, $this->sections)) {
316
+        if (!array_key_exists($section, $this->sections)) {
317 317
             $this->sections[$section] = [];
318 318
         }
319 319
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
      */
350 350
     public function show(string $sectionName)
351 351
     {
352
-        if (! isset($this->sections[$sectionName])) {
352
+        if (!isset($this->sections[$sectionName])) {
353 353
             echo '';
354 354
 
355 355
             return;
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
      *
419 419
      * @param mixed $saveData
420 420
      */
421
-    public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true): string
421
+    public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true) : string
422 422
     {
423 423
         return $this->insert($view, $data, $options, $saveData);
424 424
     }
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
     public function addLibCss(string ...$src): self
430 430
     {
431 431
         foreach ($src as $var) {
432
-            if (! in_array($var, $this->_lib_styles, true)) {
432
+            if (!in_array($var, $this->_lib_styles, true)) {
433 433
                 $this->_lib_styles[] = $var;
434 434
             }
435 435
         }
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
     public function addCss(string ...$src): self
444 444
     {
445 445
         foreach ($src as $var) {
446
-            if (! in_array($var, $this->_styles, true)) {
446
+            if (!in_array($var, $this->_styles, true)) {
447 447
                 $this->_styles[] = $var;
448 448
             }
449 449
         }
@@ -472,10 +472,10 @@  discard block
 block discarded – undo
472 472
             );
473 473
         }
474 474
 
475
-        if (! empty($lib_styles)) {
475
+        if (!empty($lib_styles)) {
476 476
             lib_styles(array_unique($lib_styles));
477 477
         }
478
-        if (! empty($styles)) {
478
+        if (!empty($styles)) {
479 479
             styles(array_unique($styles));
480 480
         }
481 481
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
     public function addLibJs(string ...$src): self
489 489
     {
490 490
         foreach ($src as $var) {
491
-            if (! in_array($var, $this->_lib_scripts, true)) {
491
+            if (!in_array($var, $this->_lib_scripts, true)) {
492 492
                 $this->_lib_scripts[] = $var;
493 493
             }
494 494
         }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
     public function addJs(string ...$src): self
503 503
     {
504 504
         foreach ($src as $var) {
505
-            if (! in_array($var, $this->_scripts, true)) {
505
+            if (!in_array($var, $this->_scripts, true)) {
506 506
                 $this->_scripts[] = $var;
507 507
             }
508 508
         }
@@ -531,10 +531,10 @@  discard block
 block discarded – undo
531 531
             );
532 532
         }
533 533
 
534
-        if (! empty($lib_scripts)) {
534
+        if (!empty($lib_scripts)) {
535 535
             lib_scripts(array_unique($lib_scripts));
536 536
         }
537
-        if (! empty($scripts)) {
537
+        if (!empty($scripts)) {
538 538
             scripts(array_unique($scripts));
539 539
         }
540 540
 
Please login to merge, or discard this patch.