@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | $this->dispatcher?->dispatch(new Finalizing($this)); |
28 | 28 | |
29 | - foreach ($this->finalizers as $finalizer) { |
|
29 | + foreach ($this->finalizers as $finalizer){ |
|
30 | 30 | \call_user_func($finalizer, $terminate); |
31 | 31 | } |
32 | 32 | } |
@@ -26,7 +26,8 @@ |
||
26 | 26 | { |
27 | 27 | $this->dispatcher?->dispatch(new Finalizing($this)); |
28 | 28 | |
29 | - foreach ($this->finalizers as $finalizer) { |
|
29 | + foreach ($this->finalizers as $finalizer) |
|
30 | + { |
|
30 | 31 | \call_user_func($finalizer, $terminate); |
31 | 32 | } |
32 | 33 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | protected readonly ExceptionHandlerInterface $exceptionHandler, |
60 | 60 | protected readonly BootloadManagerInterface $bootloader, |
61 | 61 | array $directories |
62 | - ) { |
|
62 | + ){ |
|
63 | 63 | $container->bindSingleton(ExceptionHandlerInterface::class, $exceptionHandler); |
64 | 64 | $container->bindSingleton(ExceptionRendererInterface::class, $exceptionHandler); |
65 | 65 | $container->bindSingleton(ExceptionReporterInterface::class, $exceptionHandler); |
@@ -98,17 +98,17 @@ discard block |
||
98 | 98 | final public static function create( |
99 | 99 | array $directories, |
100 | 100 | bool $handleErrors = true, |
101 | - ExceptionHandlerInterface|string|null $exceptionHandler = null, |
|
101 | + ExceptionHandlerInterface | string | null $exceptionHandler = null, |
|
102 | 102 | Container $container = new Container(), |
103 | 103 | ?BootloadManagerInterface $bootloadManager = null |
104 | 104 | ): static { |
105 | 105 | $exceptionHandler ??= ExceptionHandler::class; |
106 | 106 | |
107 | - if (\is_string($exceptionHandler)) { |
|
107 | + if (\is_string($exceptionHandler)){ |
|
108 | 108 | $exceptionHandler = $container->make($exceptionHandler); |
109 | 109 | } |
110 | 110 | |
111 | - if ($handleErrors) { |
|
111 | + if ($handleErrors){ |
|
112 | 112 | $exceptionHandler->register(); |
113 | 113 | } |
114 | 114 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $this->fireCallbacks($this->runningCallbacks); |
145 | 145 | |
146 | - try { |
|
146 | + try{ |
|
147 | 147 | // will protect any against env overwrite action |
148 | 148 | $this->container->runScope( |
149 | 149 | [EnvironmentInterface::class => $environment], |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $this->fireCallbacks($this->bootstrappedCallbacks); |
155 | 155 | } |
156 | 156 | ); |
157 | - } catch (\Throwable $e) { |
|
157 | + }catch (\Throwable $e){ |
|
158 | 158 | $this->exceptionHandler->handleGlobalException($e); |
159 | 159 | |
160 | 160 | return null; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function running(Closure ...$callbacks): void |
177 | 177 | { |
178 | - foreach ($callbacks as $callback) { |
|
178 | + foreach ($callbacks as $callback){ |
|
179 | 179 | $this->runningCallbacks[] = $callback; |
180 | 180 | } |
181 | 181 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function booting(Closure ...$callbacks): void |
192 | 192 | { |
193 | - foreach ($callbacks as $callback) { |
|
193 | + foreach ($callbacks as $callback){ |
|
194 | 194 | $this->bootingCallbacks[] = $callback; |
195 | 195 | } |
196 | 196 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function booted(Closure ...$callbacks): void |
207 | 207 | { |
208 | - foreach ($callbacks as $callback) { |
|
208 | + foreach ($callbacks as $callback){ |
|
209 | 209 | $this->bootedCallbacks[] = $callback; |
210 | 210 | } |
211 | 211 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function bootstrapped(Closure ...$callbacks): void |
223 | 223 | { |
224 | - foreach ($callbacks as $callback) { |
|
224 | + foreach ($callbacks as $callback){ |
|
225 | 225 | $this->bootstrappedCallbacks[] = $callback; |
226 | 226 | } |
227 | 227 | } |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | $eventDispatcher = $this->getEventDispatcher(); |
250 | 250 | $eventDispatcher?->dispatch(new Serving()); |
251 | 251 | |
252 | - foreach ($this->dispatchers as $dispatcher) { |
|
253 | - if ($dispatcher->canServe()) { |
|
252 | + foreach ($this->dispatchers as $dispatcher){ |
|
253 | + if ($dispatcher->canServe()){ |
|
254 | 254 | return $this->container->runScope( |
255 | 255 | [DispatcherInterface::class => $dispatcher], |
256 | 256 | static function () use ($dispatcher, $eventDispatcher): mixed { |
@@ -291,13 +291,13 @@ discard block |
||
291 | 291 | */ |
292 | 292 | protected function fireCallbacks(array &$callbacks): void |
293 | 293 | { |
294 | - if ($callbacks === []) { |
|
294 | + if ($callbacks === []){ |
|
295 | 295 | return; |
296 | 296 | } |
297 | 297 | |
298 | - do { |
|
298 | + do{ |
|
299 | 299 | $this->container->invoke(\current($callbacks)); |
300 | - } while (\next($callbacks)); |
|
300 | + }while (\next($callbacks)); |
|
301 | 301 | |
302 | 302 | $callbacks = []; |
303 | 303 | } |
@@ -104,11 +104,13 @@ discard block |
||
104 | 104 | ): static { |
105 | 105 | $exceptionHandler ??= ExceptionHandler::class; |
106 | 106 | |
107 | - if (\is_string($exceptionHandler)) { |
|
107 | + if (\is_string($exceptionHandler)) |
|
108 | + { |
|
108 | 109 | $exceptionHandler = $container->make($exceptionHandler); |
109 | 110 | } |
110 | 111 | |
111 | - if ($handleErrors) { |
|
112 | + if ($handleErrors) |
|
113 | + { |
|
112 | 114 | $exceptionHandler->register(); |
113 | 115 | } |
114 | 116 | |
@@ -143,7 +145,8 @@ discard block |
||
143 | 145 | |
144 | 146 | $this->fireCallbacks($this->runningCallbacks); |
145 | 147 | |
146 | - try { |
|
148 | + try |
|
149 | + { |
|
147 | 150 | // will protect any against env overwrite action |
148 | 151 | $this->container->runScope( |
149 | 152 | [EnvironmentInterface::class => $environment], |
@@ -154,7 +157,9 @@ discard block |
||
154 | 157 | $this->fireCallbacks($this->bootstrappedCallbacks); |
155 | 158 | } |
156 | 159 | ); |
157 | - } catch (\Throwable $e) { |
|
160 | + } |
|
161 | + catch (\Throwable $e) |
|
162 | + { |
|
158 | 163 | $this->exceptionHandler->handleGlobalException($e); |
159 | 164 | |
160 | 165 | return null; |
@@ -175,7 +180,8 @@ discard block |
||
175 | 180 | */ |
176 | 181 | public function running(Closure ...$callbacks): void |
177 | 182 | { |
178 | - foreach ($callbacks as $callback) { |
|
183 | + foreach ($callbacks as $callback) |
|
184 | + { |
|
179 | 185 | $this->runningCallbacks[] = $callback; |
180 | 186 | } |
181 | 187 | } |
@@ -190,7 +196,8 @@ discard block |
||
190 | 196 | */ |
191 | 197 | public function booting(Closure ...$callbacks): void |
192 | 198 | { |
193 | - foreach ($callbacks as $callback) { |
|
199 | + foreach ($callbacks as $callback) |
|
200 | + { |
|
194 | 201 | $this->bootingCallbacks[] = $callback; |
195 | 202 | } |
196 | 203 | } |
@@ -205,7 +212,8 @@ discard block |
||
205 | 212 | */ |
206 | 213 | public function booted(Closure ...$callbacks): void |
207 | 214 | { |
208 | - foreach ($callbacks as $callback) { |
|
215 | + foreach ($callbacks as $callback) |
|
216 | + { |
|
209 | 217 | $this->bootedCallbacks[] = $callback; |
210 | 218 | } |
211 | 219 | } |
@@ -221,7 +229,8 @@ discard block |
||
221 | 229 | */ |
222 | 230 | public function bootstrapped(Closure ...$callbacks): void |
223 | 231 | { |
224 | - foreach ($callbacks as $callback) { |
|
232 | + foreach ($callbacks as $callback) |
|
233 | + { |
|
225 | 234 | $this->bootstrappedCallbacks[] = $callback; |
226 | 235 | } |
227 | 236 | } |
@@ -249,8 +258,10 @@ discard block |
||
249 | 258 | $eventDispatcher = $this->getEventDispatcher(); |
250 | 259 | $eventDispatcher?->dispatch(new Serving()); |
251 | 260 | |
252 | - foreach ($this->dispatchers as $dispatcher) { |
|
253 | - if ($dispatcher->canServe()) { |
|
261 | + foreach ($this->dispatchers as $dispatcher) |
|
262 | + { |
|
263 | + if ($dispatcher->canServe()) |
|
264 | + { |
|
254 | 265 | return $this->container->runScope( |
255 | 266 | [DispatcherInterface::class => $dispatcher], |
256 | 267 | static function () use ($dispatcher, $eventDispatcher): mixed { |
@@ -291,11 +302,13 @@ discard block |
||
291 | 302 | */ |
292 | 303 | protected function fireCallbacks(array &$callbacks): void |
293 | 304 | { |
294 | - if ($callbacks === []) { |
|
305 | + if ($callbacks === []) |
|
306 | + { |
|
295 | 307 | return; |
296 | 308 | } |
297 | 309 | |
298 | - do { |
|
310 | + do |
|
311 | + { |
|
299 | 312 | $this->container->invoke(\current($callbacks)); |
300 | 313 | } while (\next($callbacks)); |
301 | 314 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function testLazyCommandCreationInCommandLocator(): void |
15 | 15 | { |
16 | 16 | $locator = $this->getCommandLocator( |
17 | - new class() implements ScopedClassesInterface { |
|
17 | + new class() implements ScopedClassesInterface{ |
|
18 | 18 | public function getScopedClasses(string $scope, $target = null): array |
19 | 19 | { |
20 | 20 | return [ |
@@ -14,7 +14,8 @@ |
||
14 | 14 | public function testLazyCommandCreationInCommandLocator(): void |
15 | 15 | { |
16 | 16 | $locator = $this->getCommandLocator( |
17 | - new class() implements ScopedClassesInterface { |
|
17 | + new class() implements ScopedClassesInterface |
|
18 | + { |
|
18 | 19 | public function getScopedClasses(string $scope, $target = null): array |
19 | 20 | { |
20 | 21 | return [ |
@@ -27,14 +27,14 @@ |
||
27 | 27 | |
28 | 28 | $interceptor->shouldReceive('process') |
29 | 29 | ->once() |
30 | - ->withArgs(function (string $controller, string $action, array $parameters, CoreInterface $core) { |
|
30 | + ->withArgs(function (string $controller, string $action, array $parameters, CoreInterface $core){ |
|
31 | 31 | return $controller === TestCommand::class |
32 | 32 | && $action === 'perform' |
33 | 33 | && $parameters['input'] instanceof InputInterface |
34 | 34 | && $parameters['output'] instanceof OutputInterface |
35 | 35 | && $parameters['command'] instanceof TestCommand; |
36 | 36 | }) |
37 | - ->andReturnUsing(function (string $controller, string $action, array $parameters, CoreInterface $core) { |
|
37 | + ->andReturnUsing(function (string $controller, string $action, array $parameters, CoreInterface $core){ |
|
38 | 38 | return $core->callAction($controller, $action, $parameters); |
39 | 39 | }); |
40 | 40 |
@@ -27,14 +27,16 @@ |
||
27 | 27 | |
28 | 28 | $interceptor->shouldReceive('process') |
29 | 29 | ->once() |
30 | - ->withArgs(function (string $controller, string $action, array $parameters, CoreInterface $core) { |
|
30 | + ->withArgs(function (string $controller, string $action, array $parameters, CoreInterface $core) |
|
31 | + { |
|
31 | 32 | return $controller === TestCommand::class |
32 | 33 | && $action === 'perform' |
33 | 34 | && $parameters['input'] instanceof InputInterface |
34 | 35 | && $parameters['output'] instanceof OutputInterface |
35 | 36 | && $parameters['command'] instanceof TestCommand; |
36 | 37 | }) |
37 | - ->andReturnUsing(function (string $controller, string $action, array $parameters, CoreInterface $core) { |
|
38 | + ->andReturnUsing(function (string $controller, string $action, array $parameters, CoreInterface $core) |
|
39 | + { |
|
38 | 40 | return $core->callAction($controller, $action, $parameters); |
39 | 41 | }); |
40 | 42 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $core = $this->getCore( |
15 | 15 | $this->getStaticLocator([ |
16 | - new class extends Command { |
|
16 | + new class extends Command{ |
|
17 | 17 | protected const SIGNATURE = 'foo:bar {arg?} {--o|option}'; |
18 | 18 | |
19 | 19 | public function perform(): int |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | $argument = $this->argument('arg'); |
22 | 22 | $option = $this->option('option'); |
23 | 23 | |
24 | - if ($argument) { |
|
24 | + if ($argument){ |
|
25 | 25 | $this->write('argument : '.$argument); |
26 | 26 | } |
27 | 27 | |
28 | - if ($option) { |
|
28 | + if ($option){ |
|
29 | 29 | $this->write('option : '.$option); |
30 | 30 | } |
31 | 31 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $core = $this->getCore( |
67 | 67 | $this->getStaticLocator([ |
68 | - new class extends Command { |
|
68 | + new class extends Command{ |
|
69 | 69 | protected const SIGNATURE = 'foo:bar {arg[]?} {--o|option[]=}'; |
70 | 70 | |
71 | 71 | public function perform(): int |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | $argument = (array)$this->argument('arg'); |
74 | 74 | $option = (array)$this->option('option'); |
75 | 75 | |
76 | - if ($argument) { |
|
76 | + if ($argument){ |
|
77 | 77 | $this->write('argument : '.\implode(',', $argument)); |
78 | 78 | } |
79 | 79 | |
80 | - if ($option) { |
|
80 | + if ($option){ |
|
81 | 81 | $this->write('option : '.\implode(',', $option)); |
82 | 82 | } |
83 | 83 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $core = $this->getCore( |
120 | 120 | $this->getStaticLocator([ |
121 | - new class extends Command { |
|
121 | + new class extends Command{ |
|
122 | 122 | protected const SIGNATURE = 'foo:bar |
123 | 123 | {foo : Foo arg description. } |
124 | 124 | {bar=default : Bar arg description. } |
@@ -13,7 +13,8 @@ discard block |
||
13 | 13 | { |
14 | 14 | $core = $this->getCore( |
15 | 15 | $this->getStaticLocator([ |
16 | - new class extends Command { |
|
16 | + new class extends Command |
|
17 | + { |
|
17 | 18 | protected const SIGNATURE = 'foo:bar {arg?} {--o|option}'; |
18 | 19 | |
19 | 20 | public function perform(): int |
@@ -21,11 +22,13 @@ discard block |
||
21 | 22 | $argument = $this->argument('arg'); |
22 | 23 | $option = $this->option('option'); |
23 | 24 | |
24 | - if ($argument) { |
|
25 | + if ($argument) |
|
26 | + { |
|
25 | 27 | $this->write('argument : '.$argument); |
26 | 28 | } |
27 | 29 | |
28 | - if ($option) { |
|
30 | + if ($option) |
|
31 | + { |
|
29 | 32 | $this->write('option : '.$option); |
30 | 33 | } |
31 | 34 | |
@@ -65,7 +68,8 @@ discard block |
||
65 | 68 | { |
66 | 69 | $core = $this->getCore( |
67 | 70 | $this->getStaticLocator([ |
68 | - new class extends Command { |
|
71 | + new class extends Command |
|
72 | + { |
|
69 | 73 | protected const SIGNATURE = 'foo:bar {arg[]?} {--o|option[]=}'; |
70 | 74 | |
71 | 75 | public function perform(): int |
@@ -73,11 +77,13 @@ discard block |
||
73 | 77 | $argument = (array)$this->argument('arg'); |
74 | 78 | $option = (array)$this->option('option'); |
75 | 79 | |
76 | - if ($argument) { |
|
80 | + if ($argument) |
|
81 | + { |
|
77 | 82 | $this->write('argument : '.\implode(',', $argument)); |
78 | 83 | } |
79 | 84 | |
80 | - if ($option) { |
|
85 | + if ($option) |
|
86 | + { |
|
81 | 87 | $this->write('option : '.\implode(',', $option)); |
82 | 88 | } |
83 | 89 | |
@@ -118,7 +124,8 @@ discard block |
||
118 | 124 | { |
119 | 125 | $core = $this->getCore( |
120 | 126 | $this->getStaticLocator([ |
121 | - new class extends Command { |
|
127 | + new class extends Command |
|
128 | + { |
|
122 | 129 | protected const SIGNATURE = 'foo:bar |
123 | 130 | {foo : Foo arg description. } |
124 | 131 | {bar=default : Bar arg description. } |
@@ -157,7 +157,7 @@ |
||
157 | 157 | -n, --no-interaction Do not ask any interactive question |
158 | 158 | -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug |
159 | 159 | |
160 | -HELP |
|
160 | +help |
|
161 | 161 | , |
162 | 162 | $core->run(command: 'help', input: ['command_name' => 'foo:bar'])->getOutput()->fetch() |
163 | 163 | ); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | ->method('dispatch') |
20 | 20 | ->with( |
21 | 21 | $this->callback( |
22 | - static fn(CommandStarting|CommandFinished $event): bool => $event->command instanceof TestCommand |
|
22 | + static fn(CommandStarting | CommandFinished $event): bool => $event->command instanceof TestCommand |
|
23 | 23 | ), |
24 | 24 | ); |
25 | 25 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getInterceptors(): array |
40 | 40 | { |
41 | - if (!\array_key_exists('interceptors', $this->config)) { |
|
41 | + if (!\array_key_exists('interceptors', $this->config)){ |
|
42 | 42 | return []; |
43 | 43 | } |
44 | 44 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function getCommands(): array |
52 | 52 | { |
53 | - if (!\array_key_exists('commands', $this->config)) { |
|
53 | + if (!\array_key_exists('commands', $this->config)){ |
|
54 | 54 | //Legacy config support |
55 | 55 | return []; |
56 | 56 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $sequence = (array)($this->config['sequences'][$name] ?? []); |
71 | 71 | |
72 | - foreach ($sequence as $item) { |
|
72 | + foreach ($sequence as $item){ |
|
73 | 73 | yield $this->parseSequence($item); |
74 | 74 | } |
75 | 75 | } |
@@ -108,17 +108,17 @@ discard block |
||
108 | 108 | * } $item |
109 | 109 | * @throws \JsonException |
110 | 110 | */ |
111 | - protected function parseSequence(SequenceInterface|string|array $item): SequenceInterface |
|
111 | + protected function parseSequence(SequenceInterface | string | array $item): SequenceInterface |
|
112 | 112 | { |
113 | - if ($item instanceof SequenceInterface) { |
|
113 | + if ($item instanceof SequenceInterface){ |
|
114 | 114 | return $item; |
115 | 115 | } |
116 | 116 | |
117 | - if (\is_callable($item)) { |
|
117 | + if (\is_callable($item)){ |
|
118 | 118 | return new CallableSequence($item); |
119 | 119 | } |
120 | 120 | |
121 | - if (\is_array($item) && isset($item['command'])) { |
|
121 | + if (\is_array($item) && isset($item['command'])){ |
|
122 | 122 | return new CommandSequence( |
123 | 123 | $item['command'], |
124 | 124 | $item['options'] ?? [], |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | ); |
128 | 128 | } |
129 | 129 | |
130 | - if (\is_array($item) && isset($item['invoke'])) { |
|
130 | + if (\is_array($item) && isset($item['invoke'])){ |
|
131 | 131 | return new CallableSequence( |
132 | 132 | $item['invoke'], |
133 | 133 | $item['header'] ?? '', |
@@ -38,7 +38,8 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getInterceptors(): array |
40 | 40 | { |
41 | - if (!\array_key_exists('interceptors', $this->config)) { |
|
41 | + if (!\array_key_exists('interceptors', $this->config)) |
|
42 | + { |
|
42 | 43 | return []; |
43 | 44 | } |
44 | 45 | |
@@ -50,7 +51,8 @@ discard block |
||
50 | 51 | */ |
51 | 52 | public function getCommands(): array |
52 | 53 | { |
53 | - if (!\array_key_exists('commands', $this->config)) { |
|
54 | + if (!\array_key_exists('commands', $this->config)) |
|
55 | + { |
|
54 | 56 | //Legacy config support |
55 | 57 | return []; |
56 | 58 | } |
@@ -69,7 +71,8 @@ discard block |
||
69 | 71 | { |
70 | 72 | $sequence = (array)($this->config['sequences'][$name] ?? []); |
71 | 73 | |
72 | - foreach ($sequence as $item) { |
|
74 | + foreach ($sequence as $item) |
|
75 | + { |
|
73 | 76 | yield $this->parseSequence($item); |
74 | 77 | } |
75 | 78 | } |
@@ -110,15 +113,18 @@ discard block |
||
110 | 113 | */ |
111 | 114 | protected function parseSequence(SequenceInterface|string|array $item): SequenceInterface |
112 | 115 | { |
113 | - if ($item instanceof SequenceInterface) { |
|
116 | + if ($item instanceof SequenceInterface) |
|
117 | + { |
|
114 | 118 | return $item; |
115 | 119 | } |
116 | 120 | |
117 | - if (\is_callable($item)) { |
|
121 | + if (\is_callable($item)) |
|
122 | + { |
|
118 | 123 | return new CallableSequence($item); |
119 | 124 | } |
120 | 125 | |
121 | - if (\is_array($item) && isset($item['command'])) { |
|
126 | + if (\is_array($item) && isset($item['command'])) |
|
127 | + { |
|
122 | 128 | return new CommandSequence( |
123 | 129 | $item['command'], |
124 | 130 | $item['options'] ?? [], |
@@ -127,7 +133,8 @@ discard block |
||
127 | 133 | ); |
128 | 134 | } |
129 | 135 | |
130 | - if (\is_array($item) && isset($item['invoke'])) { |
|
136 | + if (\is_array($item) && isset($item['invoke'])) |
|
137 | + { |
|
131 | 138 | return new CallableSequence( |
132 | 139 | $item['invoke'], |
133 | 140 | $item['header'] ?? '', |
@@ -43,14 +43,14 @@ |
||
43 | 43 | ? $class::DESCRIPTION |
44 | 44 | : '', |
45 | 45 | false, |
46 | - function () use ($class): SymfonyCommand { |
|
46 | + function () use ($class) : SymfonyCommand { |
|
47 | 47 | /** @var SpiralCommand $command */ |
48 | 48 | $command = $this->container->get($class); |
49 | 49 | |
50 | 50 | $command->setContainer($this->container); |
51 | 51 | $command->setInterceptors($this->interceptors); |
52 | 52 | |
53 | - if ($this->dispatcher !== null && $command instanceof EventDispatcherAwareInterface) { |
|
53 | + if ($this->dispatcher !== null && $command instanceof EventDispatcherAwareInterface){ |
|
54 | 54 | $command->setEventDispatcher($this->dispatcher); |
55 | 55 | } |
56 | 56 |
@@ -50,7 +50,8 @@ |
||
50 | 50 | $command->setContainer($this->container); |
51 | 51 | $command->setInterceptors($this->interceptors); |
52 | 52 | |
53 | - if ($this->dispatcher !== null && $command instanceof EventDispatcherAwareInterface) { |
|
53 | + if ($this->dispatcher !== null && $command instanceof EventDispatcherAwareInterface) |
|
54 | + { |
|
54 | 55 | $command->setEventDispatcher($this->dispatcher); |
55 | 56 | } |
56 | 57 |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function warning(string $string): void |
136 | 136 | { |
137 | - if (!$this->output->getFormatter()->hasStyle('warning')) { |
|
137 | + if (!$this->output->getFormatter()->hasStyle('warning')){ |
|
138 | 138 | $style = new OutputFormatterStyle('yellow'); |
139 | 139 | $this->output->getFormatter()->setStyle('warning', $style); |
140 | 140 | } |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | $stringLines = explode("\n", wordwrap($string, 300)); |
152 | 152 | |
153 | 153 | $this->comment(\str_repeat('*', $length)); |
154 | - foreach ($stringLines as $line) { |
|
155 | - $this->comment('* ' . $line . ' *'); |
|
154 | + foreach ($stringLines as $line){ |
|
155 | + $this->comment('* '.$line.' *'); |
|
156 | 156 | } |
157 | 157 | $this->comment(\str_repeat('*', $length)); |
158 | 158 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * |
199 | 199 | * @throws \InvalidArgumentException When unknown output type is given |
200 | 200 | */ |
201 | - protected function write(string|iterable $messages, bool $newline = false): void |
|
201 | + protected function write(string | iterable $messages, bool $newline = false): void |
|
202 | 202 | { |
203 | 203 | $this->output->write(messages: $messages, newline: $newline); |
204 | 204 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * |
211 | 211 | * @throws \InvalidArgumentException When unknown output type is given |
212 | 212 | */ |
213 | - protected function writeln(string|iterable $messages): void |
|
213 | + protected function writeln(string | iterable $messages): void |
|
214 | 214 | { |
215 | 215 | $this->output->writeln(messages: $messages); |
216 | 216 | } |
@@ -134,7 +134,8 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function warning(string $string): void |
136 | 136 | { |
137 | - if (!$this->output->getFormatter()->hasStyle('warning')) { |
|
137 | + if (!$this->output->getFormatter()->hasStyle('warning')) |
|
138 | + { |
|
138 | 139 | $style = new OutputFormatterStyle('yellow'); |
139 | 140 | $this->output->getFormatter()->setStyle('warning', $style); |
140 | 141 | } |
@@ -151,7 +152,8 @@ discard block |
||
151 | 152 | $stringLines = explode("\n", wordwrap($string, 300)); |
152 | 153 | |
153 | 154 | $this->comment(\str_repeat('*', $length)); |
154 | - foreach ($stringLines as $line) { |
|
155 | + foreach ($stringLines as $line) |
|
156 | + { |
|
155 | 157 | $this->comment('* ' . $line . ' *'); |
156 | 158 | } |
157 | 159 | $this->comment(\str_repeat('*', $length)); |