@@ -117,16 +117,16 @@ discard block |
||
| 117 | 117 | private function getInputOptionData(InputOption $option, bool $negated = false): array |
| 118 | 118 | { |
| 119 | 119 | return $negated ? [ |
| 120 | - 'name' => '--no-'.$option->getName(), |
|
| 120 | + 'name' => '--no-' . $option->getName(), |
|
| 121 | 121 | 'shortcut' => '', |
| 122 | 122 | 'accept_value' => false, |
| 123 | 123 | 'is_value_required' => false, |
| 124 | 124 | 'is_multiple' => false, |
| 125 | - 'description' => 'Negate the "--'.$option->getName().'" option', |
|
| 125 | + 'description' => 'Negate the "--' . $option->getName() . '" option', |
|
| 126 | 126 | 'default' => false, |
| 127 | 127 | ] : [ |
| 128 | - 'name' => '--'.$option->getName(), |
|
| 129 | - 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', |
|
| 128 | + 'name' => '--' . $option->getName(), |
|
| 129 | + 'shortcut' => $option->getShortcut() ? '-' . str_replace('|', '|-', $option->getShortcut()) : '', |
|
| 130 | 130 | 'accept_value' => $option->acceptValue(), |
| 131 | 131 | 'is_value_required' => $option->isValueRequired(), |
| 132 | 132 | 'is_multiple' => $option->isArray(), |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | foreach ($definition->getOptions() as $name => $option) { |
| 147 | 147 | $inputOptions[$name] = $this->getInputOptionData($option); |
| 148 | 148 | if ($option->isNegatable()) { |
| 149 | - $inputOptions['no-'.$name] = $this->getInputOptionData($option, true); |
|
| 149 | + $inputOptions['no-' . $name] = $this->getInputOptionData($option, true); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -205,13 +205,13 @@ discard block |
||
| 205 | 205 | $dom = new \DOMDocument('1.0', 'UTF-8'); |
| 206 | 206 | |
| 207 | 207 | $dom->appendChild($objectXML = $dom->createElement('option')); |
| 208 | - $objectXML->setAttribute('name', '--'.$option->getName()); |
|
| 208 | + $objectXML->setAttribute('name', '--' . $option->getName()); |
|
| 209 | 209 | $pos = strpos($option->getShortcut() ?? '', '|'); |
| 210 | 210 | if (false !== $pos) { |
| 211 | - $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); |
|
| 212 | - $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); |
|
| 211 | + $objectXML->setAttribute('shortcut', '-' . substr($option->getShortcut(), 0, $pos)); |
|
| 212 | + $objectXML->setAttribute('shortcuts', '-' . str_replace('|', '|-', $option->getShortcut())); |
|
| 213 | 213 | } else { |
| 214 | - $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); |
|
| 214 | + $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-' . $option->getShortcut() : ''); |
|
| 215 | 215 | } |
| 216 | 216 | $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); |
| 217 | 217 | $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); |
@@ -233,13 +233,13 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | if ($option->isNegatable()) { |
| 235 | 235 | $dom->appendChild($objectXML = $dom->createElement('option')); |
| 236 | - $objectXML->setAttribute('name', '--no-'.$option->getName()); |
|
| 236 | + $objectXML->setAttribute('name', '--no-' . $option->getName()); |
|
| 237 | 237 | $objectXML->setAttribute('shortcut', ''); |
| 238 | 238 | $objectXML->setAttribute('accept_value', 0); |
| 239 | 239 | $objectXML->setAttribute('is_value_required', 0); |
| 240 | 240 | $objectXML->setAttribute('is_multiple', 0); |
| 241 | 241 | $objectXML->appendChild($descriptionXML = $dom->createElement('description')); |
| 242 | - $descriptionXML->appendChild($dom->createTextNode('Negate the "--'.$option->getName().'" option')); |
|
| 242 | + $descriptionXML->appendChild($dom->createTextNode('Negate the "--' . $option->getName() . '" option')); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | return $dom; |
@@ -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)); |
@@ -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())); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $default = $this->getDefault(); |
| 42 | 42 | $regex = $this->trueAnswerRegex; |
| 43 | 43 | |
| 44 | - return function ($answer) use ($default, $regex) { |
|
| 44 | + return function($answer) use ($default, $regex) { |
|
| 45 | 45 | if (\is_bool($answer)) { |
| 46 | 46 | return $answer; |
| 47 | 47 | } |
@@ -61,11 +61,11 @@ |
||
| 61 | 61 | $tokens[] = $token; |
| 62 | 62 | $token = null; |
| 63 | 63 | } |
| 64 | - } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { |
|
| 65 | - $token .= $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); |
|
| 66 | - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { |
|
| 64 | + } elseif (preg_match('/([^="\'\s]+?)(=?)(' . self::REGEX_QUOTED_STRING . '+)/A', $input, $match, 0, $cursor)) { |
|
| 65 | + $token .= $match[1] . $match[2] . stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); |
|
| 66 | + } elseif (preg_match('/' . self::REGEX_QUOTED_STRING . '/A', $input, $match, 0, $cursor)) { |
|
| 67 | 67 | $token .= stripcslashes(substr($match[0], 1, -1)); |
| 68 | - } elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A', $input, $match, 0, $cursor)) { |
|
| 68 | + } elseif (preg_match('/' . self::REGEX_UNQUOTED_STRING . '/A', $input, $match, 0, $cursor)) { |
|
| 69 | 69 | $token .= $match[1]; |
| 70 | 70 | } else { |
| 71 | 71 | // should never happen |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | use Symfony\Polyfill\Mbstring as p; |
| 13 | 13 | |
| 14 | 14 | if (\PHP_VERSION_ID >= 80000) { |
| 15 | - return require __DIR__.'/bootstrap80.php'; |
|
| 15 | + return require __DIR__ . '/bootstrap80.php'; |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | if (!function_exists('mb_convert_encoding')) { |