@@ -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)); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public function __construct( |
12 | 12 | private readonly int $code, |
13 | 13 | private readonly OutputInterface $output |
14 | - ) { |
|
14 | + ){ |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function getCode(): int |
@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | public function __construct( |
15 | 15 | private readonly InvokerInterface $invoker |
16 | - ) { |
|
16 | + ){ |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -15,6 +15,6 @@ |
||
15 | 15 | public readonly int $exitCode, |
16 | 16 | public readonly InputInterface $input, |
17 | 17 | public readonly OutputInterface $output |
18 | - ) { |
|
18 | + ){ |
|
19 | 19 | } |
20 | 20 | } |
@@ -14,6 +14,6 @@ |
||
14 | 14 | public readonly Command $command, |
15 | 15 | public readonly InputInterface $input, |
16 | 16 | public readonly OutputInterface $output |
17 | - ) { |
|
17 | + ){ |
|
18 | 18 | } |
19 | 19 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | private readonly array $commands, |
23 | 23 | array $interceptors = [], |
24 | 24 | ContainerInterface $container = new Container() |
25 | - ) { |
|
25 | + ){ |
|
26 | 26 | $this->interceptors = $interceptors; |
27 | 27 | $this->container = $container; |
28 | 28 | } |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | public function locateCommands(): array |
34 | 34 | { |
35 | 35 | $commands = []; |
36 | - foreach ($this->commands as $command) { |
|
37 | - if ($command instanceof SymfonyCommand) { |
|
36 | + foreach ($this->commands as $command){ |
|
37 | + if ($command instanceof SymfonyCommand){ |
|
38 | 38 | $commands[] = $command; |
39 | 39 | continue; |
40 | 40 | } |
@@ -33,8 +33,10 @@ |
||
33 | 33 | public function locateCommands(): array |
34 | 34 | { |
35 | 35 | $commands = []; |
36 | - foreach ($this->commands as $command) { |
|
37 | - if ($command instanceof SymfonyCommand) { |
|
36 | + foreach ($this->commands as $command) |
|
37 | + { |
|
38 | + if ($command instanceof SymfonyCommand) |
|
39 | + { |
|
38 | 40 | $commands[] = $command; |
39 | 41 | continue; |
40 | 42 | } |
@@ -12,19 +12,19 @@ |
||
12 | 12 | public function __construct( |
13 | 13 | private readonly string $header, |
14 | 14 | private readonly string $footer |
15 | - ) { |
|
15 | + ){ |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | public function writeHeader(OutputInterface $output): void |
19 | 19 | { |
20 | - if (!empty($this->header)) { |
|
20 | + if (!empty($this->header)){ |
|
21 | 21 | $output->writeln($this->header); |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | 25 | public function writeFooter(OutputInterface $output): void |
26 | 26 | { |
27 | - if (!empty($this->footer)) { |
|
27 | + if (!empty($this->footer)){ |
|
28 | 28 | $output->writeln($this->footer); |
29 | 29 | } |
30 | 30 | } |
@@ -17,14 +17,16 @@ |
||
17 | 17 | |
18 | 18 | public function writeHeader(OutputInterface $output): void |
19 | 19 | { |
20 | - if (!empty($this->header)) { |
|
20 | + if (!empty($this->header)) |
|
21 | + { |
|
21 | 22 | $output->writeln($this->header); |
22 | 23 | } |
23 | 24 | } |
24 | 25 | |
25 | 26 | public function writeFooter(OutputInterface $output): void |
26 | 27 | { |
27 | - if (!empty($this->footer)) { |
|
28 | + if (!empty($this->footer)) |
|
29 | + { |
|
28 | 30 | $output->writeln($this->footer); |
29 | 31 | } |
30 | 32 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | private readonly array $options = [], |
19 | 19 | string $header = '', |
20 | 20 | string $footer = '' |
21 | - ) { |
|
21 | + ){ |
|
22 | 22 | parent::__construct($header, $footer); |
23 | 23 | } |
24 | 24 |
@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | * @param string|callable|array<class-string, string> $function |
21 | 21 | */ |
22 | 22 | public function __construct( |
23 | - string|array|callable $function, |
|
23 | + string | array | callable $function, |
|
24 | 24 | string $header = '', |
25 | 25 | string $footer = '' |
26 | - ) { |
|
26 | + ){ |
|
27 | 27 | $this->function = $function; |
28 | 28 | parent::__construct($header, $footer); |
29 | 29 | } |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | public function execute(ContainerInterface $container, OutputInterface $output): void |
32 | 32 | { |
33 | 33 | $function = $this->function; |
34 | - if (\is_string($function) && \str_contains($function, ':')) { |
|
34 | + if (\is_string($function) && \str_contains($function, ':')){ |
|
35 | 35 | $function = \explode(':', \str_replace('::', ':', $function)); |
36 | 36 | } |
37 | 37 | |
38 | - if (\is_array($function) && isset($function[0]) && !\is_object($function[0])) { |
|
38 | + if (\is_array($function) && isset($function[0]) && !\is_object($function[0])){ |
|
39 | 39 | $function[0] = $container->get($function[0]); |
40 | 40 | } |
41 | 41 | |
42 | 42 | /** @var ResolverInterface $resolver */ |
43 | 43 | $resolver = $container->get(ResolverInterface::class); |
44 | 44 | |
45 | - if (\is_array($function)) { |
|
45 | + if (\is_array($function)){ |
|
46 | 46 | $reflection = new \ReflectionMethod($function[0], $function[1]); |
47 | 47 | $reflection->invokeArgs($function[0], $resolver->resolveArguments($reflection, [ |
48 | 48 | 'output' => $output, |
@@ -31,18 +31,21 @@ |
||
31 | 31 | public function execute(ContainerInterface $container, OutputInterface $output): void |
32 | 32 | { |
33 | 33 | $function = $this->function; |
34 | - if (\is_string($function) && \str_contains($function, ':')) { |
|
34 | + if (\is_string($function) && \str_contains($function, ':')) |
|
35 | + { |
|
35 | 36 | $function = \explode(':', \str_replace('::', ':', $function)); |
36 | 37 | } |
37 | 38 | |
38 | - if (\is_array($function) && isset($function[0]) && !\is_object($function[0])) { |
|
39 | + if (\is_array($function) && isset($function[0]) && !\is_object($function[0])) |
|
40 | + { |
|
39 | 41 | $function[0] = $container->get($function[0]); |
40 | 42 | } |
41 | 43 | |
42 | 44 | /** @var ResolverInterface $resolver */ |
43 | 45 | $resolver = $container->get(ResolverInterface::class); |
44 | 46 | |
45 | - if (\is_array($function)) { |
|
47 | + if (\is_array($function)) |
|
48 | + { |
|
46 | 49 | $reflection = new \ReflectionMethod($function[0], $function[1]); |
47 | 50 | $reflection->invokeArgs($function[0], $resolver->resolveArguments($reflection, [ |
48 | 51 | 'output' => $output, |