@@ -485,14 +485,14 @@ discard block |
||
485 | 485 | if ($titleLength > $limit = $markupLength - 4) { |
486 | 486 | $titleLength = $limit; |
487 | 487 | $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); |
488 | - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); |
|
488 | + $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3) . '...'); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | $titleStart = intdiv($markupLength - $titleLength, 2); |
492 | 492 | if (false === mb_detect_encoding($markup, null, true)) { |
493 | 493 | $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); |
494 | 494 | } else { |
495 | - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); |
|
495 | + $markup = mb_substr($markup, 0, $titleStart) . $formattedTitle . mb_substr($markup, $titleStart + $titleLength); |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | $cellFormat = $cell->getStyle()->getCellFormat(); |
568 | 568 | if (!\is_string($cellFormat)) { |
569 | 569 | $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); |
570 | - $cellFormat = '<'.$tag.'>%s</>'; |
|
570 | + $cellFormat = '<' . $tag . '>%s</>'; |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | if (strstr($content, '</>')) { |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | $eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n"; |
625 | 625 | $escaped = implode($eol, array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode($eol, $cell))); |
626 | 626 | $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; |
627 | - $lines = explode($eol, str_replace($eol, '<fg=default;bg=default></>'.$eol, $cell)); |
|
627 | + $lines = explode($eol, str_replace($eol, '<fg=default;bg=default></>' . $eol, $cell)); |
|
628 | 628 | foreach ($lines as $lineKey => $line) { |
629 | 629 | if ($colspan > 1) { |
630 | 630 | $line = new TableCell($line, ['colspan' => $colspan]); |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | } |
642 | 642 | } |
643 | 643 | |
644 | - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { |
|
644 | + return new TableRows(function() use ($rows, $unmergedRows): \Traversable { |
|
645 | 645 | foreach ($rows as $rowKey => $row) { |
646 | 646 | $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)]; |
647 | 647 | |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | $lines = [$cell]; |
688 | 688 | if (strstr($cell, "\n")) { |
689 | 689 | $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; |
690 | - $lines = explode($eol, str_replace($eol, '<fg=default;bg=default>'.$eol.'</>', $cell)); |
|
690 | + $lines = explode($eol, str_replace($eol, '<fg=default;bg=default>' . $eol . '</>', $cell)); |
|
691 | 691 | $nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines; |
692 | 692 | |
693 | 693 | $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | return array_filter( |
69 | 69 | $this->getOptions(), |
70 | - function ($key) { |
|
70 | + function($key) { |
|
71 | 71 | return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); |
72 | 72 | }, |
73 | 73 | \ARRAY_FILTER_USE_KEY |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | $this->cloner = $cloner; |
34 | 34 | |
35 | 35 | if (class_exists(CliDumper::class)) { |
36 | - $this->handler = function ($var): string { |
|
36 | + $this->handler = function($var): string { |
|
37 | 37 | $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); |
38 | 38 | $dumper->setColors($this->output->isDecorated()); |
39 | 39 | |
40 | 40 | return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true)); |
41 | 41 | }; |
42 | 42 | } else { |
43 | - $this->handler = function ($var): string { |
|
43 | + $this->handler = function($var): string { |
|
44 | 44 | switch (true) { |
45 | 45 | case null === $var: |
46 | 46 | return 'null'; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | case false === $var: |
50 | 50 | return 'false'; |
51 | 51 | case \is_string($var): |
52 | - return '"'.$var.'"'; |
|
52 | + return '"' . $var . '"'; |
|
53 | 53 | default: |
54 | 54 | return rtrim(print_r($var, true)); |
55 | 55 | } |
@@ -111,10 +111,10 @@ |
||
111 | 111 | $glue = ('-' === $param[1]) ? '=' : ' '; |
112 | 112 | if (\is_array($val)) { |
113 | 113 | foreach ($val as $v) { |
114 | - $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); |
|
114 | + $params[] = $param . ('' != $v ? $glue . $this->escapeToken($v) : ''); |
|
115 | 115 | } |
116 | 116 | } else { |
117 | - $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); |
|
117 | + $params[] = $param . ('' != $val ? $glue . $this->escapeToken($val) : ''); |
|
118 | 118 | } |
119 | 119 | } else { |
120 | 120 | $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | // Options with values: |
314 | 314 | // For long options, test for '--option=' at beginning |
315 | 315 | // For short options, test for '-o' at beginning |
316 | - $leading = str_starts_with($value, '--') ? $value.'=' : $value; |
|
316 | + $leading = str_starts_with($value, '--') ? $value . '=' : $value; |
|
317 | 317 | if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { |
318 | 318 | return true; |
319 | 319 | } |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | // Options with values: |
345 | 345 | // For long options, test for '--option=' at beginning |
346 | 346 | // For short options, test for '-o' at beginning |
347 | - $leading = str_starts_with($value, '--') ? $value.'=' : $value; |
|
347 | + $leading = str_starts_with($value, '--') ? $value . '=' : $value; |
|
348 | 348 | if ('' !== $leading && str_starts_with($token, $leading)) { |
349 | 349 | return substr($token, \strlen($leading)); |
350 | 350 | } |
@@ -361,9 +361,9 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function __toString() |
363 | 363 | { |
364 | - $tokens = array_map(function ($token) { |
|
364 | + $tokens = array_map(function($token) { |
|
365 | 365 | if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { |
366 | - return $match[1].$this->escapeToken($match[2]); |
|
366 | + return $match[1] . $this->escapeToken($match[2]); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | if ($token && '-' !== $token[0]) { |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | } |
252 | 252 | |
253 | 253 | if ($option->isNegatable()) { |
254 | - $negatedName = 'no-'.$option->getName(); |
|
254 | + $negatedName = 'no-' . $option->getName(); |
|
255 | 255 | if (isset($this->options[$negatedName])) { |
256 | 256 | throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); |
257 | 257 | } |
@@ -406,19 +406,19 @@ discard block |
||
406 | 406 | |
407 | 407 | $tail = ''; |
408 | 408 | foreach ($this->getArguments() as $argument) { |
409 | - $element = '<'.$argument->getName().'>'; |
|
409 | + $element = '<' . $argument->getName() . '>'; |
|
410 | 410 | if ($argument->isArray()) { |
411 | 411 | $element .= '...'; |
412 | 412 | } |
413 | 413 | |
414 | 414 | if (!$argument->isRequired()) { |
415 | - $element = '['.$element; |
|
415 | + $element = '[' . $element; |
|
416 | 416 | $tail .= ']'; |
417 | 417 | } |
418 | 418 | |
419 | 419 | $elements[] = $element; |
420 | 420 | } |
421 | 421 | |
422 | - return implode(' ', $elements).$tail; |
|
422 | + return implode(' ', $elements) . $tail; |
|
423 | 423 | } |
424 | 424 | } |
@@ -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 |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $definition = $this->definition; |
69 | 69 | $givenArguments = $this->arguments; |
70 | 70 | |
71 | - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { |
|
71 | + $missingArguments = array_filter(array_keys($definition->getArguments()), function($argument) use ($definition, $givenArguments) { |
|
72 | 72 | return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); |
73 | 73 | }); |
74 | 74 |
@@ -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')) { |