@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | return; |
187 | 187 | } |
188 | 188 | |
189 | - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { |
|
189 | + $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function($matches) { |
|
190 | 190 | if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { |
191 | 191 | return $formatter($this); |
192 | 192 | } |
@@ -230,16 +230,16 @@ discard block |
||
230 | 230 | private static function initPlaceholderFormatters(): array |
231 | 231 | { |
232 | 232 | return [ |
233 | - 'indicator' => function (self $indicator) { |
|
233 | + 'indicator' => function(self $indicator) { |
|
234 | 234 | return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; |
235 | 235 | }, |
236 | - 'message' => function (self $indicator) { |
|
236 | + 'message' => function(self $indicator) { |
|
237 | 237 | return $indicator->message; |
238 | 238 | }, |
239 | - 'elapsed' => function (self $indicator) { |
|
239 | + 'elapsed' => function(self $indicator) { |
|
240 | 240 | return Helper::formatTime(time() - $indicator->startTime); |
241 | 241 | }, |
242 | - 'memory' => function () { |
|
242 | + 'memory' => function() { |
|
243 | 243 | return Helper::formatMemory(memory_get_usage(true)); |
244 | 244 | }, |
245 | 245 | ]; |
@@ -120,7 +120,7 @@ |
||
120 | 120 | |
121 | 121 | $formatter = $this->getHelperSet()->get('debug_formatter'); |
122 | 122 | |
123 | - return function ($type, $buffer) use ($output, $process, $callback, $formatter) { |
|
123 | + return function($type, $buffer) use ($output, $process, $callback, $formatter) { |
|
124 | 124 | $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); |
125 | 125 | |
126 | 126 | if (null !== $callback) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | $messages = $large ? [str_repeat(' ', $len)] : []; |
55 | 55 | for ($i = 0; isset($lines[$i]); ++$i) { |
56 | - $messages[] = $lines[$i].str_repeat(' ', $len - self::width($lines[$i])); |
|
56 | + $messages[] = $lines[$i] . str_repeat(' ', $len - self::width($lines[$i])); |
|
57 | 57 | } |
58 | 58 | if ($large) { |
59 | 59 | $messages[] = str_repeat(' ', $len); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | return $message; |
80 | 80 | } |
81 | 81 | |
82 | - return self::substr($message, 0, $length).$suffix; |
|
82 | + return self::substr($message, 0, $length) . $suffix; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -130,7 +130,7 @@ |
||
130 | 130 | return $format[1]; |
131 | 131 | } |
132 | 132 | |
133 | - return floor($secs / $format[2]).' '.$format[1]; |
|
133 | + return floor($secs / $format[2]) . ' ' . $format[1]; |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | } |
@@ -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]) { |