@@ -274,7 +274,7 @@ |
||
274 | 274 | $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; |
275 | 275 | |
276 | 276 | $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) |
277 | - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); |
|
277 | + ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); |
|
278 | 278 | |
279 | 279 | if ($j %= 28) { |
280 | 280 | $uchr .= $j < 25 |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | |
157 | 157 | $ucls = $combClass[$uchr] ?? 0; |
158 | 158 | |
159 | - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { |
|
160 | - $lastUchr = $compMap[$lastUchr.$uchr]; |
|
159 | + if (isset($compMap[$lastUchr . $uchr]) && (!$lastUcls || $lastUcls < $ucls)) { |
|
160 | + $lastUchr = $compMap[$lastUchr . $uchr]; |
|
161 | 161 | } elseif ($lastUcls = $ucls) { |
162 | 162 | $tail .= $uchr; |
163 | 163 | } else { |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; |
188 | - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); |
|
188 | + $lastUchr = \chr(0xE0 | $L >> 12) . \chr(0x80 | $L >> 6 & 0x3F) . \chr(0x80 | $L & 0x3F); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | $i += $ulen; |
192 | 192 | } |
193 | 193 | |
194 | - return $result.$lastUchr.$tail; |
|
194 | + return $result . $lastUchr . $tail; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | private static function decompose($s, $c) |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $i -= $j; |
247 | 247 | |
248 | 248 | if (0 > $i) { |
249 | - $s = str_repeat(' ', -$i).$s; |
|
249 | + $s = str_repeat(' ', -$i) . $s; |
|
250 | 250 | $len -= $i; |
251 | 251 | $i = 0; |
252 | 252 | } |
@@ -273,13 +273,13 @@ discard block |
||
273 | 273 | $uchr = unpack('C*', $uchr); |
274 | 274 | $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; |
275 | 275 | |
276 | - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) |
|
277 | - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); |
|
276 | + $uchr = "\xE1\x84" . \chr(0x80 + (int) ($j / 588)) |
|
277 | + ."\xE1\x85" . \chr(0xA1 + (int) (($j % 588) / 28)); |
|
278 | 278 | |
279 | 279 | if ($j %= 28) { |
280 | 280 | $uchr .= $j < 25 |
281 | - ? ("\xE1\x86".\chr(0xA7 + $j)) |
|
282 | - : ("\xE1\x87".\chr(0x67 + $j)); |
|
281 | + ? ("\xE1\x86" . \chr(0xA7 + $j)) |
|
282 | + : ("\xE1\x87" . \chr(0x67 + $j)); |
|
283 | 283 | } |
284 | 284 | } |
285 | 285 | if ($c) { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | private static function getData($file) |
303 | 303 | { |
304 | - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { |
|
304 | + if (file_exists($file = __DIR__ . '/Resources/unidata/' . $file . '.php')) { |
|
305 | 305 | return require $file; |
306 | 306 | } |
307 | 307 |
@@ -29,21 +29,21 @@ |
||
29 | 29 | // on the input arrays. This ordering of the characters avoids the use of strtr, |
30 | 30 | // which performs more slowly. |
31 | 31 | private const ESCAPEES = ['\\', '\\\\', '\\"', '"', |
32 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | - "\x7f", |
|
37 | - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
|
38 | - ]; |
|
32 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | + "\x7f", |
|
37 | + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
|
38 | + ]; |
|
39 | 39 | private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"', |
40 | - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
41 | - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
42 | - '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
|
43 | - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
44 | - '\\x7f', |
|
45 | - '\\N', '\\_', '\\L', '\\P', |
|
46 | - ]; |
|
40 | + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
41 | + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
42 | + '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
|
43 | + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
44 | + '\\x7f', |
|
45 | + '\\N', '\\_', '\\L', '\\P', |
|
46 | + ]; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Determines if a PHP value would require double quoting in YAML. |
@@ -29,18 +29,18 @@ discard block |
||
29 | 29 | // on the input arrays. This ordering of the characters avoids the use of strtr, |
30 | 30 | // which performs more slowly. |
31 | 31 | private const ESCAPEES = ['\\', '\\\\', '\\"', '"', |
32 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
32 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
33 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
34 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
35 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
36 | 36 | "\x7f", |
37 | 37 | "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", |
38 | 38 | ]; |
39 | 39 | private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"', |
40 | - '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
41 | - '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
40 | + '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', |
|
41 | + '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', |
|
42 | 42 | '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', |
43 | - '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
43 | + '\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', |
|
44 | 44 | '\\x7f', |
45 | 45 | '\\N', '\\_', '\\L', '\\P', |
46 | 46 | ]; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public static function requiresDoubleQuoting(string $value): bool |
54 | 54 | { |
55 | - return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); |
|
55 | + return 0 < preg_match('/' . self::REGEX_CHARACTER_TO_ESCAPE . '/u', $value); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -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 | } |