@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'À' => 'À', |
5 | 5 | 'Á' => 'Á', |
6 | 6 | 'Â' => 'Â', |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | ' ' => ' ', |
5 | 5 | '¨' => ' ̈', |
6 | 6 | 'ª' => 'a', |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'À' => 'À', |
5 | 5 | 'Á' => 'Á', |
6 | 6 | 'Â' => 'Â', |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | '̀' => 230, |
5 | 5 | '́' => 230, |
6 | 6 | '̂' => 230, |
@@ -15,5 +15,5 @@ |
||
15 | 15 | function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } |
16 | 16 | } |
17 | 17 | if (!function_exists('normalizer_normalize')) { |
18 | - function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } |
|
18 | + function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string | false { return p\Normalizer::normalize((string) $string, (int) $form); } |
|
19 | 19 | } |
@@ -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 |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | return sprintf('!php/const %s::%s', \get_class($value), $value->name); |
134 | 134 | case \is_object($value): |
135 | 135 | if ($value instanceof TaggedValue) { |
136 | - return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags); |
|
136 | + return '!' . $value->getTag() . ' ' . self::dump($value->getValue(), $flags); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | if (Yaml::DUMP_OBJECT & $flags) { |
140 | - return '!php/object '.self::dump(serialize($value)); |
|
140 | + return '!php/object ' . self::dump(serialize($value)); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } elseif (floor($value) == $value && $repr == $value) { |
178 | 178 | // Preserve float data type since storing a whole number will result in integer value. |
179 | 179 | if (false === strpos($repr, 'E')) { |
180 | - $repr = $repr.'.0'; |
|
180 | + $repr = $repr . '.0'; |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | } else { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | case '' == $value: |
192 | 192 | return "''"; |
193 | 193 | case self::isBinaryString($value): |
194 | - return '!!binary '.base64_encode($value); |
|
194 | + return '!!binary ' . base64_encode($value); |
|
195 | 195 | case Escaper::requiresDoubleQuoting($value): |
196 | 196 | return Escaper::escapeWithDoubleQuotes($value); |
197 | 197 | case Escaper::requiresSingleQuoting($value): |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | if (Parser::preg_match('/[ \t]+#/', $output, $match, \PREG_OFFSET_CAPTURE)) { |
298 | 298 | $output = substr($output, 0, $match[0][1]); |
299 | 299 | } |
300 | - } elseif (Parser::preg_match('/^(.*?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { |
|
300 | + } elseif (Parser::preg_match('/^(.*?)(' . implode('|', $delimiters) . ')/', substr($scalar, $i), $match)) { |
|
301 | 301 | $output = $match[1]; |
302 | 302 | $i += \strlen($output); |
303 | 303 | $output = trim($output); |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | private static function parseQuotedScalar(string $scalar, int &$i = 0): string |
327 | 327 | { |
328 | - if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { |
|
328 | + if (!Parser::preg_match('/' . self::REGEX_QUOTED_STRING . '/Au', substr($scalar, $i), $match)) { |
|
329 | 329 | throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); |
330 | 330 | } |
331 | 331 | |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | // embedded mapping? |
391 | 391 | try { |
392 | 392 | $pos = 0; |
393 | - $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references); |
|
393 | + $value = self::parseMapping('{' . $value . '}', $flags, $pos, $references); |
|
394 | 394 | } catch (\InvalidArgumentException $e) { |
395 | 395 | // no, it's not |
396 | 396 | } |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | } |
458 | 458 | |
459 | 459 | if ('!php/const' === $key) { |
460 | - $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false); |
|
460 | + $key .= ' ' . self::parseScalar($mapping, $flags, [':'], $i, false); |
|
461 | 461 | $key = self::evaluateScalar($key, $flags); |
462 | 462 | } |
463 | 463 | |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | switch (true) { |
678 | 678 | case ctype_digit($scalar): |
679 | 679 | if (preg_match('/^0[0-7]+$/', $scalar)) { |
680 | - trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '0o'.substr($scalar, 1)); |
|
680 | + trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '0o' . substr($scalar, 1)); |
|
681 | 681 | |
682 | 682 | return octdec($scalar); |
683 | 683 | } |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | return ($scalar === (string) $cast) ? $cast : $scalar; |
688 | 688 | case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)): |
689 | 689 | if (preg_match('/^-0[0-7]+$/', $scalar)) { |
690 | - trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '-0o'.substr($scalar, 2)); |
|
690 | + trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '-0o' . substr($scalar, 2)); |
|
691 | 691 | |
692 | 692 | return -octdec(substr($scalar, 1)); |
693 | 693 | } |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | case Parser::preg_match(self::getHexRegex(), $scalar): |
700 | 700 | $scalar = str_replace('_', '', $scalar); |
701 | 701 | |
702 | - return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar; |
|
702 | + return '0x' === $scalar[0] . $scalar[1] ? hexdec($scalar) : (float) $scalar; |
|
703 | 703 | case '.inf' === $scalarLower: |
704 | 704 | case '.nan' === $scalarLower: |
705 | 705 | return -log(0); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | private function validate(string $content, int $flags, ?string $file = null) |
137 | 137 | { |
138 | - $prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) { |
|
138 | + $prevErrorHandler = set_error_handler(function($level, $message, $file, $line) use (&$prevErrorHandler) { |
|
139 | 139 | if (\E_USER_DEPRECATED === $level) { |
140 | 140 | throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1); |
141 | 141 | } |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | |
181 | 181 | foreach ($filesInfo as $info) { |
182 | 182 | if ($info['valid'] && $this->displayCorrectFiles) { |
183 | - $io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); |
|
183 | + $io->comment('<info>OK</info>' . ($info['file'] ? sprintf(' in %s', $info['file']) : '')); |
|
184 | 184 | } elseif (!$info['valid']) { |
185 | 185 | ++$erroredFiles; |
186 | - $io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); |
|
186 | + $io->text('<error> ERROR </error>' . ($info['file'] ? sprintf(' in %s', $info['file']) : '')); |
|
187 | 187 | $io->text(sprintf('<error> >> %s</error>', $info['message'])); |
188 | 188 | |
189 | 189 | if (false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | { |
210 | 210 | $errors = 0; |
211 | 211 | |
212 | - array_walk($filesInfo, function (&$v) use (&$errors) { |
|
212 | + array_walk($filesInfo, function(&$v) use (&$errors) { |
|
213 | 213 | $v['file'] = (string) $v['file']; |
214 | 214 | if (!$v['valid']) { |
215 | 215 | ++$errors; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | private function getDirectoryIterator(string $directory): iterable |
255 | 255 | { |
256 | - $default = function ($directory) { |
|
256 | + $default = function($directory) { |
|
257 | 257 | return new \RecursiveIteratorIterator( |
258 | 258 | new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), |
259 | 259 | \RecursiveIteratorIterator::LEAVES_ONLY |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | |
270 | 270 | private function isReadable(string $fileOrDirectory): bool |
271 | 271 | { |
272 | - $default = function ($fileOrDirectory) { |
|
272 | + $default = function($fileOrDirectory) { |
|
273 | 273 | return is_readable($fileOrDirectory); |
274 | 274 | }; |
275 | 275 |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | $sequenceIndentation = \strlen($values['leadspaces']) + 1; |
183 | 183 | $sequenceYaml = substr($this->currentLine, $sequenceIndentation); |
184 | - $sequenceYaml .= "\n".$this->getNextEmbedBlock($sequenceIndentation, true); |
|
184 | + $sequenceYaml .= "\n" . $this->getNextEmbedBlock($sequenceIndentation, true); |
|
185 | 185 | |
186 | 186 | $data[] = $this->parseBlock($currentLineNumber, rtrim($sequenceYaml), $flags); |
187 | 187 | } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { |
@@ -196,12 +196,12 @@ discard block |
||
196 | 196 | isset($values['leadspaces']) |
197 | 197 | && ( |
198 | 198 | '!' === $values['value'][0] |
199 | - || self::preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->trimTag($values['value']), $matches) |
|
199 | + || self::preg_match('#^(?P<key>' . Inline::REGEX_QUOTED_STRING . '|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->trimTag($values['value']), $matches) |
|
200 | 200 | ) |
201 | 201 | ) { |
202 | 202 | $block = $values['value']; |
203 | 203 | if ($this->isNextLineIndented() || isset($matches['value']) && '>-' === $matches['value']) { |
204 | - $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1); |
|
204 | + $block .= "\n" . $this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $flags); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | array_pop($this->refsBeingParsed); |
215 | 215 | } |
216 | 216 | } elseif ( |
217 | - self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P<value>.+))?$#u', rtrim($this->currentLine), $values) |
|
217 | + self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:' . Inline::REGEX_QUOTED_STRING . '|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P<value>.+))?$#u', rtrim($this->currentLine), $values) |
|
218 | 218 | && (false === strpos($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"])) |
219 | 219 | ) { |
220 | 220 | if ($context && 'sequence' == $context) { |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | if (!\is_string($key) && !\is_int($key)) { |
235 | - throw new ParseException((is_numeric($key) ? 'Numeric' : 'Non-string').' keys are not supported. Quote your evaluable mapping keys instead.', $this->getRealCurrentLineNb() + 1, $this->currentLine); |
|
235 | + throw new ParseException((is_numeric($key) ? 'Numeric' : 'Non-string') . ' keys are not supported. Quote your evaluable mapping keys instead.', $this->getRealCurrentLineNb() + 1, $this->currentLine); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | // Convert float keys to strings, to avoid being converted to integers by PHP |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | return $this->refs[$value]; |
738 | 738 | } |
739 | 739 | |
740 | - if (\in_array($value[0], ['!', '|', '>'], true) && self::preg_match('/^(?:'.self::TAG_PATTERN.' +)?'.self::BLOCK_SCALAR_HEADER_PATTERN.'$/', $value, $matches)) { |
|
740 | + if (\in_array($value[0], ['!', '|', '>'], true) && self::preg_match('/^(?:' . self::TAG_PATTERN . ' +)?' . self::BLOCK_SCALAR_HEADER_PATTERN . '$/', $value, $matches)) { |
|
741 | 741 | $modifiers = $matches['modifiers'] ?? ''; |
742 | 742 | |
743 | 743 | $data = $this->parseBlockScalar($matches['separator'], preg_replace('#\d+#', '', $modifiers), abs((int) $modifiers)); |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | $value .= $lines[$i]; |
798 | 798 | $previousLineBlank = false; |
799 | 799 | } else { |
800 | - $value .= ' '.$lines[$i]; |
|
800 | + $value .= ' ' . $lines[$i]; |
|
801 | 801 | $previousLineBlank = false; |
802 | 802 | } |
803 | 803 | } |
@@ -900,11 +900,11 @@ discard block |
||
900 | 900 | $previousLineIndented = false; |
901 | 901 | $previousLineBlank = true; |
902 | 902 | } elseif (' ' === $blockLines[$i][0]) { |
903 | - $text .= "\n".$blockLines[$i]; |
|
903 | + $text .= "\n" . $blockLines[$i]; |
|
904 | 904 | $previousLineIndented = true; |
905 | 905 | $previousLineBlank = false; |
906 | 906 | } elseif ($previousLineIndented) { |
907 | - $text .= "\n".$blockLines[$i]; |
|
907 | + $text .= "\n" . $blockLines[$i]; |
|
908 | 908 | $previousLineIndented = false; |
909 | 909 | $previousLineBlank = false; |
910 | 910 | } elseif ($previousLineBlank || 0 === $i) { |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | $previousLineIndented = false; |
913 | 913 | $previousLineBlank = false; |
914 | 914 | } else { |
915 | - $text .= ' '.$blockLines[$i]; |
|
915 | + $text .= ' ' . $blockLines[$i]; |
|
916 | 916 | $previousLineIndented = false; |
917 | 917 | $previousLineBlank = false; |
918 | 918 | } |
@@ -1128,7 +1128,7 @@ discard block |
||
1128 | 1128 | |
1129 | 1129 | private function getLineTag(string $value, int $flags, bool $nextLineCheck = true): ?string |
1130 | 1130 | { |
1131 | - if ('' === $value || '!' !== $value[0] || 1 !== self::preg_match('/^'.self::TAG_PATTERN.' *( +#.*)?$/', $value, $matches)) { |
|
1131 | + if ('' === $value || '!' !== $value[0] || 1 !== self::preg_match('/^' . self::TAG_PATTERN . ' *( +#.*)?$/', $value, $matches)) { |
|
1132 | 1132 | return null; |
1133 | 1133 | } |
1134 | 1134 | |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | if ("'" === $quotation) { |
1178 | 1178 | $value .= '\\'; |
1179 | 1179 | } elseif (isset($this->currentLine[++$cursor])) { |
1180 | - $value .= '\\'.$this->currentLine[$cursor]; |
|
1180 | + $value .= '\\' . $this->currentLine[$cursor]; |
|
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | break; |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | break; |
1190 | 1190 | } |
1191 | 1191 | |
1192 | - return $value.$quotation; |
|
1192 | + return $value . $quotation; |
|
1193 | 1193 | default: |
1194 | 1194 | $value .= $this->currentLine[$cursor]; |
1195 | 1195 | } |