@@ -23,9 +23,9 @@ |
||
23 | 23 | { |
24 | 24 | $values = $suggestions->getValueSuggestions(); |
25 | 25 | foreach ($suggestions->getOptionSuggestions() as $option) { |
26 | - $values[] = '--'.$option->getName(); |
|
26 | + $values[] = '--' . $option->getName(); |
|
27 | 27 | if ($option->isNegatable()) { |
28 | - $values[] = '--no-'.$option->getName(); |
|
28 | + $values[] = '--no-' . $option->getName(); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | $output->writeln(implode("\n", $values)); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | protected function configure(): void |
50 | 50 | { |
51 | 51 | $this |
52 | - ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")') |
|
52 | + ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("' . implode('", "', array_keys($this->completionOutputs)) . '")') |
|
53 | 53 | ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)') |
54 | 54 | ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)') |
55 | 55 | ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'The version of the completion script') |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | |
90 | 90 | $this->log([ |
91 | 91 | '', |
92 | - '<comment>'.date('Y-m-d H:i:s').'</>', |
|
92 | + '<comment>' . date('Y-m-d H:i:s') . '</>', |
|
93 | 93 | '<info>Input:</> <comment>("|" indicates the cursor position)</>', |
94 | - ' '.(string) $completionInput, |
|
94 | + ' ' . (string) $completionInput, |
|
95 | 95 | '<info>Command:</>', |
96 | - ' '.(string) implode(' ', $_SERVER['argv']), |
|
96 | + ' ' . (string) implode(' ', $_SERVER['argv']), |
|
97 | 97 | '<info>Messages:</>', |
98 | 98 | ]); |
99 | 99 | |
@@ -116,16 +116,16 @@ discard block |
||
116 | 116 | $completionInput->bind($command->getDefinition()); |
117 | 117 | |
118 | 118 | if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { |
119 | - $this->log(' Completing option names for the <comment>'.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).'</> command.'); |
|
119 | + $this->log(' Completing option names for the <comment>' . \get_class($command instanceof LazyCommand ? $command->getCommand() : $command) . '</> command.'); |
|
120 | 120 | |
121 | 121 | $suggestions->suggestOptions($command->getDefinition()->getOptions()); |
122 | 122 | } else { |
123 | 123 | $this->log([ |
124 | - ' Completing using the <comment>'.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).'</> class.', |
|
125 | - ' Completing <comment>'.$completionInput->getCompletionType().'</> for <comment>'.$completionInput->getCompletionName().'</>', |
|
124 | + ' Completing using the <comment>' . \get_class($command instanceof LazyCommand ? $command->getCommand() : $command) . '</> class.', |
|
125 | + ' Completing <comment>' . $completionInput->getCompletionType() . '</> for <comment>' . $completionInput->getCompletionName() . '</>', |
|
126 | 126 | ]); |
127 | 127 | if (null !== $compval = $completionInput->getCompletionValue()) { |
128 | - $this->log(' Current value: <comment>'.$compval.'</>'); |
|
128 | + $this->log(' Current value: <comment>' . $compval . '</>'); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | $command->complete($completionInput, $suggestions); |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | |
138 | 138 | $this->log('<info>Suggestions:</>'); |
139 | 139 | if ($options = $suggestions->getOptionSuggestions()) { |
140 | - $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); |
|
140 | + $this->log(' --' . implode(' --', array_map(function($o) { return $o->getName(); }, $options))); |
|
141 | 141 | } elseif ($values = $suggestions->getValueSuggestions()) { |
142 | - $this->log(' '.implode(' ', $values)); |
|
142 | + $this->log(' ' . implode(' ', $values)); |
|
143 | 143 | } else { |
144 | 144 | $this->log(' <comment>No suggestions were provided</>'); |
145 | 145 | } |
@@ -200,6 +200,6 @@ discard block |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | $commandName = basename($_SERVER['argv'][0]); |
203 | - file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND); |
|
203 | + file_put_contents(sys_get_temp_dir() . '/sf_' . $commandName . '.log', implode(\PHP_EOL, (array) $messages) . \PHP_EOL, \FILE_APPEND); |
|
204 | 204 | } |
205 | 205 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | $shell = $input->getArgument('shell') ?? self::guessShell(); |
92 | - $completionFile = __DIR__.'/../Resources/completion.'.$shell; |
|
92 | + $completionFile = __DIR__ . '/../Resources/completion.' . $shell; |
|
93 | 93 | if (!file_exists($completionFile)) { |
94 | 94 | $supportedShells = $this->getSupportedShells(); |
95 | 95 | |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | |
118 | 118 | private function tailDebugLog(string $commandName, OutputInterface $output): void |
119 | 119 | { |
120 | - $debugFile = sys_get_temp_dir().'/sf_'.$commandName.'.log'; |
|
120 | + $debugFile = sys_get_temp_dir() . '/sf_' . $commandName . '.log'; |
|
121 | 121 | if (!file_exists($debugFile)) { |
122 | 122 | touch($debugFile); |
123 | 123 | } |
124 | 124 | $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); |
125 | - $process->run(function (string $type, string $line) use ($output): void { |
|
125 | + $process->run(function(string $type, string $line) use ($output): void { |
|
126 | 126 | $output->write($line); |
127 | 127 | }); |
128 | 128 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | { |
135 | 135 | $shells = []; |
136 | 136 | |
137 | - foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { |
|
137 | + foreach (new \DirectoryIterator(__DIR__ . '/../Resources/') as $file) { |
|
138 | 138 | if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { |
139 | 139 | $shells[] = $file->getExtension(); |
140 | 140 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | if ($code instanceof \Closure) { |
332 | 332 | $r = new \ReflectionFunction($code); |
333 | 333 | if (null === $r->getClosureThis()) { |
334 | - set_error_handler(static function () {}); |
|
334 | + set_error_handler(static function() {}); |
|
335 | 335 | try { |
336 | 336 | if ($c = \Closure::bind($code, $this)) { |
337 | 337 | $code = $c; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | ]; |
595 | 595 | $replacements = [ |
596 | 596 | $name, |
597 | - $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, |
|
597 | + $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'] . ' ' . $name, |
|
598 | 598 | ]; |
599 | 599 | |
600 | 600 | return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | protected function failureDescription($other): string |
39 | 39 | { |
40 | - return 'the command '.$this->toString(); |
|
40 | + return 'the command ' . $this->toString(); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -75,7 +75,7 @@ |
||
75 | 75 | unset($_SERVER['SHELL_VERBOSITY']); |
76 | 76 | } else { |
77 | 77 | if (\function_exists('putenv')) { |
78 | - @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); |
|
78 | + @putenv('SHELL_VERBOSITY=' . $prevShellVerbosity); |
|
79 | 79 | } |
80 | 80 | $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; |
81 | 81 | $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; |
@@ -187,7 +187,7 @@ |
||
187 | 187 | $stream = fopen('php://memory', 'r+', false); |
188 | 188 | |
189 | 189 | foreach ($inputs as $input) { |
190 | - fwrite($stream, $input.\PHP_EOL); |
|
190 | + fwrite($stream, $input . \PHP_EOL); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | rewind($stream); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | $options = []; |
50 | 50 | foreach ($suggestions->getOptionSuggestions() as $option) { |
51 | - $options[] = '--'.$option->getName(); |
|
51 | + $options[] = '--' . $option->getName(); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); |
@@ -69,7 +69,7 @@ |
||
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | |
72 | - return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); |
|
72 | + return self::$stty = (bool) shell_exec('stty 2> ' . ('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | private static function initDimensions() |