Passed
Pull Request — main (#18)
by Dimitri
03:55
created
src/Cli/Commands/Utilities/About.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         collect(static::$data)
80 80
             ->map(
81 81
                 static fn ($items) => collect($items)
82
-                    ->map(static function ($value) {
82
+                    ->map(static function($value) {
83 83
                         if (is_array($value)) {
84 84
                             return [$value];
85 85
                         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                             ->all();
95 95
                     })->flatten(1)
96 96
             )
97
-            ->sortBy(static function ($data, $key) {
97
+            ->sortBy(static function($data, $key) {
98 98
                 $index = array_search($key, ['Environnement', 'Cache', 'Gestionnaires'], true);
99 99
 
100 100
                 return $index === false ? 99 : $index;
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
      */
119 119
     protected function displayDetail(Collection $data): void
120 120
     {
121
-        $data->each(function ($data, $section): void {
121
+        $data->each(function($data, $section): void {
122 122
             $this->newLine();
123 123
 
124 124
             $this->justify($section, '', ['first' => ['fg' => Color::GREEN]]);
125 125
 
126
-            $data->pipe(static fn ($data) => $section !== 'Environnement' ? $data->sort() : $data)->each(function ($detail): void {
126
+            $data->pipe(static fn ($data) => $section !== 'Environnement' ? $data->sort() : $data)->each(function($detail): void {
127 127
                 [$label, $value] = $detail;
128
-                if (! in_array($label, static::$displayed, true)) {
128
+                if (!in_array($label, static::$displayed, true)) {
129 129
                     $this->justify($label, value($value, false));
130 130
                     static::$displayed[] = $label;
131 131
                 }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 
180 180
         static::addToSection('Gestionnaires', static fn () => array_filter([
181 181
             'Cache' => config('cache.handler'),
182
-            'Logs'  => static function ($json) {
182
+            'Logs'  => static function($json) {
183 183
                 $handlers = [];
184 184
 
185 185
                 foreach (config('log.handlers') as $k => $v) {
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
      */
253 253
     public static function format(mixed $value, ?Closure $console = null, ?Closure $json = null)
254 254
     {
255
-        return static function ($isJson) use ($value, $console, $json) {
255
+        return static function($isJson) use ($value, $console, $json) {
256 256
             if ($isJson === true && $json instanceof Closure) {
257 257
                 return value($json, $value);
258 258
             }
Please login to merge, or discard this patch.
src/Cli/Console/Console.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
         foreach ($options as $key => $value) {
160 160
             $key = preg_replace('/^\-\-/', '', $key);
161
-            if (! isset($options[$key])) {
161
+            if (!isset($options[$key])) {
162 162
                 $options[$key] = $value;
163 163
             }
164 164
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      */
172 172
     public function commandExists(string $commandName): bool
173 173
     {
174
-        return ! empty($this->_commands[$commandName]);
174
+        return !empty($this->_commands[$commandName]);
175 175
     }
176 176
 
177 177
     /**
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         foreach ($files as $file) {
207 207
             $className = $locator->findQualifiedNameFromPath($file);
208 208
 
209
-            if ($className === false || ! class_exists($className)) {
209
+            if ($className === false || !class_exists($className)) {
210 210
                 continue;
211 211
             }
212 212
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         $class  = new ReflectionClass($className);
233 233
         $logger = $logger ?: Services::logger();
234 234
 
235
-        if (! $class->isInstantiable() || ! $class->isSubclassOf(Command::class)) {
235
+        if (!$class->isInstantiable() || !$class->isSubclassOf(Command::class)) {
236 236
             throw CLIException::invalidCommand($className);
237 237
         }
238 238
 
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
             $value = (array) $value;
260 260
 
261 261
             $description = $value[0];
262
-            if (! is_string($description)) {
262
+            if (!is_string($description)) {
263 263
                 continue;
264 264
             }
265 265
 
266 266
             $default = $value[1] ?? null;
267 267
             $filter  = $value[2] ?? null;
268
-            if ($filter !== null && ! is_callable($filter)) {
268
+            if ($filter !== null && !is_callable($filter)) {
269 269
                 $filter = null;
270 270
             }
271 271
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             $value = (array) $value;
278 278
 
279 279
             $description = $value[0];
280
-            if (! is_string($description)) {
280
+            if (!is_string($description)) {
281 281
                 continue;
282 282
             }
283 283
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         }
288 288
 
289 289
         $console = $this;
290
-        $action  = function (?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) {
290
+        $action  = function(?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) {
291 291
             foreach ($instance->required as $package) {
292 292
                 $package = explode(':', $package);
293 293
                 $version = $package[1] ?? null;
@@ -296,9 +296,9 @@  discard block
 block discarded – undo
296 296
                 /** @var Interactor $io */
297 297
                 $io = $this->io();
298 298
 
299
-                if (! InstalledVersions::isInstalled($package)) {
299
+                if (!InstalledVersions::isInstalled($package)) {
300 300
                     $io->info('Cette commande nécessite le package "' . $package . '" mais vous ne l\'avez pas', true);
301
-                    if (! $io->confirm('Voulez-vous l\'installer maintenant ?')) {
301
+                    if (!$io->confirm('Voulez-vous l\'installer maintenant ?')) {
302 302
                         return;
303 303
                     }
304 304
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             }
315 315
 
316 316
             $suppress = $suppress ?: $console->suppress;
317
-            if (! $suppress) {
317
+            if (!$suppress) {
318 318
                 $console->start($instance);
319 319
             }
320 320
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
             $result = $instance->setOptions($options)->setArguments($arguments)->execute($parameters);
331 331
 
332
-            if (! $suppress) {
332
+            if (!$suppress) {
333 333
                 $console->end();
334 334
             }
335 335
 
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
     private function registerException(Logger $logger)
346 346
     {
347
-        $this->onException(static function (Throwable $e, int $exitCode) use ($logger): void {
347
+        $this->onException(static function(Throwable $e, int $exitCode) use ($logger): void {
348 348
             $logger->error((string) $e, ['exitCode' => $exitCode, 'klinge' => true]);
349 349
 
350 350
             throw new CLIException($e->getMessage(), $exitCode, $e);
Please login to merge, or discard this patch.
rector.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
43 43
 
44 44
 return RectorConfig::configure()
45
-	->withPhpSets(php81: true)
46
-	->withPreparedSets(deadCode: true)
47
-	->withParallel(120, 8, 10)
45
+    ->withPhpSets(php81: true)
46
+    ->withPreparedSets(deadCode: true)
47
+    ->withParallel(120, 8, 10)
48 48
     ->withCache(
49 49
         // Github action cache or local
50 50
         is_dir('/tmp') ? '/tmp/rector' : null,
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     ->withPHPStanConfigs([
63 63
         // __DIR__ . '/phpstan.neon.dist',
64 64
     ])
65
-	// is there a file you need to skip?
65
+    // is there a file you need to skip?
66 66
     ->withSkip([
67 67
         __DIR__ . '/src/Debug/Toolbar/Views/toolbar.tpl.php',
68 68
         __DIR__ . '/spec/support/application/app/Views',
@@ -120,5 +120,5 @@  discard block
 block discarded – undo
120 120
         StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true,
121 121
     ])
122 122
 
123
-	;
123
+    ;
124 124
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
         NullToStrictStringFuncCallArgRector::class,
82 82
     ])
83 83
     // auto import fully qualified class names
84
-    ->withImportNames(removeUnusedImports: true)
84
+    ->withImportNames(removeUnusedImports : true)
85 85
     ->withRules([
86 86
         // DeclareStrictTypesRector::class,
87 87
         SimplifyUselessVariableRector::class,
Please login to merge, or discard this patch.
src/Cli/Traits/GeneratorTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             // @codeCoverageIgnoreStart
165 165
             $this->colorize(lang('CLI.generator.usingBlitzNamespace'), 'yellow');
166 166
 
167
-            if (! $this->confirm('Are you sure you want to continue?')) {
167
+            if (!$this->confirm('Are you sure you want to continue?')) {
168 168
                 $this->eol()->colorize(lang('CLI.generator.cancelOperation'), 'yellow');
169 169
 
170 170
                 return;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
         // Écraser des fichiers sans le savoir est une gêne sérieuse, nous allons donc vérifier si nous dupliquons des choses,
180 180
         // si l'option "forcer" n'est pas fournie, nous renvoyons.
181
-        if (! $this->option('force') && $isFile) {
181
+        if (!$this->option('force') && $isFile) {
182 182
             $this->io->error(lang('CLI.generator.fileExist', [clean_path($target)]), true);
183 183
 
184 184
             return;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         // Vérifie si le répertoire pour enregistrer le fichier existe.
188 188
         $dir = dirname($target);
189 189
 
190
-        if (! is_dir($dir)) {
190
+        if (!is_dir($dir)) {
191 191
             mkdir($dir, 0o755, true);
192 192
         }
193 193
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         // Construisez la classe en fonction des détails dont nous disposons.
197 197
         // Nous obtiendrons le contenu de notre fichier à partir du modèle,
198 198
         // puis nous effectuerons les remplacements nécessaires.
199
-        if (! write_file($target, $content)) {
199
+        if (!write_file($target, $content)) {
200 200
             // @codeCoverageIgnoreStart
201 201
             $this->io->error(lang('CLI.generator.fileError', [clean_path($target)]), true);
202 202
 
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         // Vérifier que le namespace est réellement défini et que nous ne sommes pas en train de taper du charabia.
322 322
         $base = service('autoloader')->getNamespace($namespace);
323 323
 
324
-        if (! $base = reset($base)) {
324
+        if (!$base = reset($base)) {
325 325
             $this->io->error(lang('CLI.namespaceNotDefined', [$namespace]), true);
326 326
 
327 327
             return '';
Please login to merge, or discard this patch.
src/Cli/Commands/Cache/Clear.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $config  = config('cache');
55 55
         $handler = $this->argument('driver', $params[0] ?? $config['handler']);
56 56
 
57
-        if (! array_key_exists($handler, $config['valid_handlers'])) {
57
+        if (!array_key_exists($handler, $config['valid_handlers'])) {
58 58
             $this->fail($handler . ' n\'est pas un gestionnaire de cache valide.');
59 59
 
60 60
             return;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $config['handler'] = $handler;
64 64
         $cache             = Services::cache($config);
65 65
 
66
-        if (! $cache->clear()) {
66
+        if (!$cache->clear()) {
67 67
             // @codeCoverageIgnoreStart
68 68
             $this->fail('Erreur lors de l\'effacement du cache.');
69 69
 
Please login to merge, or discard this patch.
src/Event/EventManager.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         return true;
111 111
     }
112 112
 
113
-	/**
113
+    /**
114 114
      * @deprecated use off() instead
115 115
      */
116 116
     public function detach(string $event, callable $callback, int $priority = 0): bool
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
         return $result;
168 168
     }
169 169
 
170
-	/**
171
-	 * @deprecated use emit() instead
172
-	 */
173
-	public function trigger($event, $target = null, $argv = [])
170
+    /**
171
+     * @deprecated use emit() instead
172
+     */
173
+    public function trigger($event, $target = null, $argv = [])
174 174
     {
175 175
         return $this->emit($event, $target, $argv);
176 176
     }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function __construct(array $events = [])
48 48
     {
49 49
         $this->events = $events;
50
-        if (! array_key_exists(self::WILDCARD, $this->events)) {
50
+        if (!array_key_exists(self::WILDCARD, $this->events)) {
51 51
             $this->events[self::WILDCARD] = [];
52 52
         }
53 53
     }
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function on(string $event, callable $callback, int $priority = 0): bool
67 67
     {
68
-        if (! array_key_exists($event, $this->events)) {
68
+        if (!array_key_exists($event, $this->events)) {
69 69
             $this->events[$event] = [];
70 70
         }
71
-        if (! array_key_exists($priority, $this->events[$event])) {
71
+        if (!array_key_exists($priority, $this->events[$event])) {
72 72
             $this->events[$event][$priority] = [];
73 73
         }
74 74
 
75
-        if (! in_array($callback, $this->events[$event][$priority], true)) {
75
+        if (!in_array($callback, $this->events[$event][$priority], true)) {
76 76
             $this->events[$event][$priority][] = $callback;
77 77
 
78 78
             return true;
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function off(string $event, callable $callback): bool
96 96
     {
97
-        if (! array_key_exists($event, $this->events) || ! $this->events[$event]) {
97
+        if (!array_key_exists($event, $this->events) || !$this->events[$event]) {
98 98
             return false;
99 99
         }
100 100
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public function emit($event, $target = null, $argv = [])
125 125
     {
126
-        if (! ($event instanceof EventInterface)) {
126
+        if (!($event instanceof EventInterface)) {
127 127
             $event = new Event($event, $target, $argv);
128 128
         } else {
129 129
             if ($target) {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         }
136 136
 
137 137
         $eventName = $event->getName();
138
-        if (! array_key_exists($eventName, $this->events)) {
138
+        if (!array_key_exists($eventName, $this->events)) {
139 139
             $this->events[$eventName] = [];
140 140
         }
141 141
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         $result = null;
144 144
 
145 145
         foreach ($events as $priority) {
146
-            if (! is_array($priority)) {
146
+            if (!is_array($priority)) {
147 147
                 continue;
148 148
             }
149 149
 
Please login to merge, or discard this patch.