Passed
Push — main ( 4acb40 )
by Dimitri
12:56
created
src/Config/Config.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         if (is_array($config)) {
89 89
             foreach ($config as $key => $value) {
90
-                if (! is_string($value) || empty($value)) {
90
+                if (!is_string($value) || empty($value)) {
91 91
                     continue;
92 92
                 }
93 93
                 if (is_string($key)) {
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
                 }
100 100
                 self::load($conf, $file);
101 101
             }
102
-        } elseif (is_string($config) && ! isset(self::$loaded[$config])) {
102
+        } elseif (is_string($config) && !isset(self::$loaded[$config])) {
103 103
             if (empty($file)) {
104 104
                 $file = self::path($config);
105 105
             }
106 106
 
107 107
             $configurations = [];
108
-            if (file_exists($file) && ! in_array($file, get_included_files(), true)) {
108
+            if (file_exists($file) && !in_array($file, get_included_files(), true)) {
109 109
                 $configurations = (array) require $file;
110 110
             }
111 111
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         if (is_array($accepts_values)) {
132 132
             $accepts_values = '(Accept values: ' . implode('/', $accepts_values) . ')';
133
-        } elseif (! is_string($accepts_values)) {
133
+        } elseif (!is_string($accepts_values)) {
134 134
             throw new InvalidArgumentException('Misuse of the method ' . __METHOD__);
135 135
         }
136 136
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $schema = require $app_schema;
177 177
         }
178 178
 
179
-        if (empty($schema) || ! ($schema instanceof Schema)) {
179
+        if (empty($schema) || !($schema instanceof Schema)) {
180 180
             $schema = Expect::mixed();
181 181
         }
182 182
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     private function initializeURL()
203 203
     {
204
-        if (! $this->configurator->exists('app.base_url')) {
204
+        if (!$this->configurator->exists('app.base_url')) {
205 205
             $config = 'auto';
206 206
         } else {
207 207
             $config = $this->configurator->get('app.base_url');
@@ -257,17 +257,17 @@  discard block
 block discarded – undo
257 257
      */
258 258
     private function initializeDebugbar()
259 259
     {
260
-        if (! $this->configurator->exists('app.show_debugbar')) {
260
+        if (!$this->configurator->exists('app.show_debugbar')) {
261 261
             $config = 'auto';
262 262
         } else {
263 263
             $config = $this->configurator->get('app.show_debugbar');
264 264
         }
265 265
 
266
-        if (! in_array($config, ['auto', true, false], true)) {
266
+        if (!in_array($config, ['auto', true, false], true)) {
267 267
             self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app');
268 268
         }
269 269
         if ($config === 'auto') {
270
-            $this->configurator->set('app.show_debugbar', ! is_online());
270
+            $this->configurator->set('app.show_debugbar', !is_online());
271 271
         }
272 272
     }
273 273
 }
Please login to merge, or discard this patch.
src/Debug/Toolbar/Collectors/BaseCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
      */
109 109
     public function timelineData(): array
110 110
     {
111
-        if (! $this->hasTimeline) {
111
+        if (!$this->hasTimeline) {
112 112
             return [];
113 113
         }
114 114
 
Please login to merge, or discard this patch.
src/Debug/Toolbar/Collectors/LogsCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
      */
78 78
     protected function collectLogs()
79 79
     {
80
-        if (! empty($this->data)) {
80
+        if (!empty($this->data)) {
81 81
             return $this->data;
82 82
         }
83 83
 
Please login to merge, or discard this patch.
src/Debug/Toolbar/Collectors/DatabaseCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
      */
140 140
     public function display(): array
141 141
     {
142
-        $data['queries'] = array_map(static function (array $query) {
142
+        $data['queries'] = array_map(static function(array $query) {
143 143
             $isDuplicate = $query['duplicate'] === true;
144 144
 
145 145
             $firstNonSystemLine = '';
Please login to merge, or discard this patch.
src/Debug/Toolbar/Collectors/RoutesCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             $method = new ReflectionFunction($controllerName);
65 65
         } else {
66 66
             try {
67
-                $method = new ReflectionMethod($controllerName, ! empty($methodName) ? $methodName : $router->methodName());
67
+                $method = new ReflectionMethod($controllerName, !empty($methodName) ? $methodName : $router->methodName());
68 68
             } catch (ReflectionException $e) {
69 69
                 // Si nous sommes ici, la méthode n'existe pas
70 70
                 // et est probablement calculé dans _remap.
Please login to merge, or discard this patch.
src/Debug/Toolbar/Collectors/EventsCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
         foreach (EventManager::getPerformanceLogs() as $row) {
91 91
             $key = $row['event'];
92 92
 
93
-            if (! array_key_exists($key, $data['events'])) {
93
+            if (!array_key_exists($key, $data['events'])) {
94 94
                 $data['events'][$key] = [
95 95
                     'event'    => $key,
96 96
                     'duration' => number_format(($row['end'] - $row['start']) * 1000, 2),
Please login to merge, or discard this patch.
src/Debug/Toolbar/views/toolbar.tpl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         </span>
43 43
 
44 44
         <?php foreach ($collectors as $c) : ?>
45
-            <?php if (! $c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?>
45
+            <?php if (!$c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?>
46 46
                 <span class="ci-label">
47 47
                     <a href="javascript: void(0)" data-tab="ci-<?= $c['titleSafe'] ?>">
48 48
                         <img src="<?= $c['icon'] ?>">
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
     <!-- Collector-provided Tabs -->
104 104
     <?php foreach ($collectors as $c) : ?>
105
-        <?php if (! $c['isEmpty']) : ?>
105
+        <?php if (!$c['isEmpty']) : ?>
106 106
             <?php if ($c['hasTabContent']) : ?>
107 107
                 <div id="ci-<?= $c['titleSafe'] ?>" class="tab">
108 108
                     <h2><?= $c['title'] ?> <span><?= $c['titleDetails'] ?></span></h2>
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         </a>
150 150
 
151 151
         <?php if (isset($vars['session'])) : ?>
152
-            <?php if (! empty($vars['session'])) : ?>
152
+            <?php if (!empty($vars['session'])) : ?>
153 153
                 <table id="session_table">
154 154
                     <tbody>
155 155
                     <?php foreach ($vars['session'] as $key => $value) : ?>
Please login to merge, or discard this patch.
src/Debug/Toolbar.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $this->config = $config ?? (object) config('toolbar');
66 66
 
67 67
         foreach ($this->config->collectors as $collector) {
68
-            if (! class_exists($collector)) {
68
+            if (!class_exists($collector)) {
69 69
                 logger()->critical(
70 70
                     'Toolbar collector does not exist (' . $collector . ').'
71 71
                     . ' Please check $collectors in the app/Config/toolbar.php file.'
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             $data['vars']['varData'][esc($heading)] = $varData;
132 132
         }
133 133
 
134
-        if (! empty($_SESSION)) {
134
+        if (!empty($_SESSION)) {
135 135
             foreach ($_SESSION as $key => $value) {
136 136
                 // Remplacez les données binaires par une chaîne pour éviter l'échec de json_encode.
137 137
                 if (is_string($value) && preg_match('~[^\x20-\x7E\t\r\n]~', $value)) {
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                 continue;
156 156
             }
157 157
 
158
-            if (! is_array($value)) {
158
+            if (!is_array($value)) {
159 159
                 $value = [$value];
160 160
             }
161 161
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 continue;
185 185
             }
186 186
 
187
-            if (! is_array($value)) {
187
+            if (!is_array($value)) {
188 188
                 $value = [$value];
189 189
             }
190 190
 
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
         $output = '';
223 223
 
224 224
         foreach ($rows as $row) {
225
-            $hasChildren = isset($row['children']) && ! empty($row['children']);
226
-            $isQuery     = isset($row['query']) && ! empty($row['query']);
225
+            $hasChildren = isset($row['children']) && !empty($row['children']);
226
+            $isQuery     = isset($row['query']) && !empty($row['query']);
227 227
 
228 228
             // Ouvrir la chronologie du contrôleur par défaut
229 229
             $open = $row['name'] === 'Controller';
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
         // Le collecter
290 290
         foreach ($collectors as $collector) {
291
-            if (! $collector['hasTimelineData']) {
291
+            if (!$collector['hasTimelineData']) {
292 292
                 continue;
293 293
             }
294 294
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         array_multisort(...$sortArray);
306 306
 
307 307
         // Ajouter une heure de fin à chaque élément
308
-        array_walk($data, static function (&$row) {
308
+        array_walk($data, static function(&$row) {
309 309
             $row['end'] = $row['start'] + $row['duration'];
310 310
         });
311 311
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         $element = array_shift($elements);
325 325
 
326 326
         // Si nous avons des enfants derrière nous, récupérez-les et attachez-les-nous
327
-        while (! empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) {
327
+        while (!empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) {
328 328
             $element['children'][] = array_shift($elements);
329 329
         }
330 330
 
@@ -348,14 +348,14 @@  discard block
 block discarded – undo
348 348
      */
349 349
     protected function collectVarData(): array
350 350
     {
351
-        if (! ($this->config->collectVarData ?? true)) {
351
+        if (!($this->config->collectVarData ?? true)) {
352 352
             return [];
353 353
         }
354 354
 
355 355
         $data = [];
356 356
 
357 357
         foreach ($this->collectors as $collector) {
358
-            if (! $collector->hasVarData()) {
358
+            if (!$collector->hasVarData()) {
359 359
                 continue;
360 360
             }
361 361
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         }
390 390
 
391 391
         // Si on a desactiver le debogage ou l'affichage de la debugbar, on s'arrete
392
-        if (! BLITZ_DEBUG || ! $this->config->show_debugbar) {
392
+        if (!BLITZ_DEBUG || !$this->config->show_debugbar) {
393 393
             return $response;
394 394
         }
395 395
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         // Mise à jour vers microtime() pour que nous puissions obtenir l'historique
405 405
         $time = sprintf('%.6f', microtime(true));
406 406
 
407
-        if (! is_dir($this->debugPath)) {
407
+        if (!is_dir($this->debugPath)) {
408 408
             mkdir($this->debugPath, 0777);
409 409
         }
410 410
 
Please login to merge, or discard this patch.
src/Http/Uri.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
 
173 173
         $authority = $this->host;
174 174
 
175
-        if (! empty($this->getUserInfo())) {
175
+        if (!empty($this->getUserInfo())) {
176 176
             $authority = $this->getUserInfo() . '@' . $authority;
177 177
         }
178 178
 
179
-        if (! empty($this->port) && ! $ignorePort) {
179
+        if (!empty($this->port) && !$ignorePort) {
180 180
             // N'ajoute pas de port s'il s'agit d'un port standard pour ce schéma
181 181
             if ($this->port !== $this->defaultPorts[$this->scheme]) {
182 182
                 $authority .= ':' . $this->port;
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     {
196 196
         $userInfo = $this->user;
197 197
 
198
-        if ($this->showPassword === true && ! empty($this->password)) {
198
+        if ($this->showPassword === true && !empty($this->password)) {
199 199
             $userInfo .= ':' . $this->password;
200 200
         }
201 201
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         $vars = $this->query;
246 246
 
247 247
         if (array_key_exists('except', $options)) {
248
-            if (! is_array($options['except'])) {
248
+            if (!is_array($options['except'])) {
249 249
                 $options['except'] = [$options['except']];
250 250
             }
251 251
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         } elseif (array_key_exists('only', $options)) {
256 256
             $temp = [];
257 257
 
258
-            if (! is_array($options['only'])) {
258
+            if (!is_array($options['only'])) {
259 259
                 $options['only'] = [$options['only']];
260 260
             }
261 261
 
@@ -356,11 +356,11 @@  discard block
 block discarded – undo
356 356
     public static function createURIString(?string $scheme = null, ?string $authority = null, ?string $path = null, ?string $query = null, ?string $fragment = null): string
357 357
     {
358 358
         $uri = '';
359
-        if (! empty($scheme)) {
359
+        if (!empty($scheme)) {
360 360
             $uri .= $scheme . '://';
361 361
         }
362 362
 
363
-        if (! empty($authority)) {
363
+        if (!empty($authority)) {
364 364
             $uri .= $authority;
365 365
         }
366 366
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     {
387 387
         $parts = parse_url($str);
388 388
 
389
-        if (empty($parts['host']) && ! empty($parts['path'])) {
389
+        if (empty($parts['host']) && !empty($parts['path'])) {
390 390
             $parts['host'] = $parts['path'];
391 391
             unset($parts['path']);
392 392
         }
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
         }
532 532
 
533 533
         // Ne peut pas avoir de début ?
534
-        if (! empty($query) && strpos($query, '?') === 0) {
534
+        if (!empty($query) && strpos($query, '?') === 0) {
535 535
             $query = substr($query, 1);
536 536
         }
537 537
 
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
         $temp = [];
597 597
 
598 598
         foreach ($this->query as $key => $value) {
599
-            if (! in_array($key, $params, true)) {
599
+            if (!in_array($key, $params, true)) {
600 600
                 continue;
601 601
             }
602 602
 
@@ -667,19 +667,19 @@  discard block
 block discarded – undo
667 667
      */
668 668
     protected function applyParts(array $parts)
669 669
     {
670
-        if (! empty($parts['host'])) {
670
+        if (!empty($parts['host'])) {
671 671
             $this->host = $parts['host'];
672 672
         }
673
-        if (! empty($parts['user'])) {
673
+        if (!empty($parts['user'])) {
674 674
             $this->user = $parts['user'];
675 675
         }
676
-        if (! empty($parts['path'])) {
676
+        if (!empty($parts['path'])) {
677 677
             $this->path = $this->filterPath($parts['path']);
678 678
         }
679
-        if (! empty($parts['query'])) {
679
+        if (!empty($parts['query'])) {
680 680
             $this->setQuery($parts['query']);
681 681
         }
682
-        if (! empty($parts['fragment'])) {
682
+        if (!empty($parts['fragment'])) {
683 683
             $this->fragment = $parts['fragment'];
684 684
         }
685 685
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
             $this->password = $parts['pass'];
702 702
         }
703 703
 
704
-        if (! empty($parts['path'])) {
704
+        if (!empty($parts['path'])) {
705 705
             $this->segments = explode('/', trim($parts['path'], '/'));
706 706
         }
707 707
     }
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
         $transformed = clone $relative;
729 729
 
730 730
         // 5.2.2 Transformer les références dans une méthode non stricte (pas de schéma)
731
-        if (! empty($relative->getAuthority())) {
731
+        if (!empty($relative->getAuthority())) {
732 732
             $transformed->setAuthority($relative->getAuthority())
733 733
                 ->setPath($relative->getPath())
734 734
                 ->setQuery($relative->getQuery());
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
      */
769 769
     protected function mergePaths(self $base, self $reference): string
770 770
     {
771
-        if (! empty($base->getAuthority()) && empty($base->getPath())) {
771
+        if (!empty($base->getAuthority()) && empty($base->getPath())) {
772 772
             return '/' . ltrim($reference->getPath(), '/ ');
773 773
         }
774 774
 
Please login to merge, or discard this patch.