@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | public function run(InputInterface $input = null, OutputInterface $output = null) |
134 | 134 | { |
135 | 135 | if (\function_exists('putenv')) { |
136 | - @putenv('LINES='.$this->terminal->getHeight()); |
|
137 | - @putenv('COLUMNS='.$this->terminal->getWidth()); |
|
136 | + @putenv('LINES=' . $this->terminal->getHeight()); |
|
137 | + @putenv('COLUMNS=' . $this->terminal->getWidth()); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | if (null === $input) { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $output = new ConsoleOutput(); |
146 | 146 | } |
147 | 147 | |
148 | - $renderException = function (\Throwable $e) use ($output) { |
|
148 | + $renderException = function(\Throwable $e) use ($output) { |
|
149 | 149 | if ($output instanceof ConsoleOutputInterface) { |
150 | 150 | $this->renderThrowable($e, $output->getErrorOutput()); |
151 | 151 | } else { |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | $exitCode = $e->getCode(); |
176 | 176 | if (is_numeric($exitCode)) { |
177 | - $exitCode = (int) $exitCode; |
|
177 | + $exitCode = (int)$exitCode; |
|
178 | 178 | if (0 === $exitCode) { |
179 | 179 | $exitCode = 1; |
180 | 180 | } |
@@ -589,8 +589,8 @@ discard block |
||
589 | 589 | public function findNamespace(string $namespace) |
590 | 590 | { |
591 | 591 | $allNamespaces = $this->getNamespaces(); |
592 | - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; |
|
593 | - $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); |
|
592 | + $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))) . '[^:]*'; |
|
593 | + $namespaces = preg_grep('{^' . $expr . '}', $allNamespaces); |
|
594 | 594 | |
595 | 595 | if (empty($namespaces)) { |
596 | 596 | $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); |
@@ -645,15 +645,15 @@ discard block |
||
645 | 645 | } |
646 | 646 | |
647 | 647 | $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); |
648 | - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; |
|
649 | - $commands = preg_grep('{^'.$expr.'}', $allCommands); |
|
648 | + $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))) . '[^:]*'; |
|
649 | + $commands = preg_grep('{^' . $expr . '}', $allCommands); |
|
650 | 650 | |
651 | 651 | if (empty($commands)) { |
652 | - $commands = preg_grep('{^'.$expr.'}i', $allCommands); |
|
652 | + $commands = preg_grep('{^' . $expr . '}i', $allCommands); |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | // if no commands matched or we just matched namespaces |
656 | - if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { |
|
656 | + if (empty($commands) || \count(preg_grep('{^' . $expr . '$}i', $commands)) < 1) { |
|
657 | 657 | if (false !== $pos = strrpos($name, ':')) { |
658 | 658 | // check if a namespace exists and contains commands |
659 | 659 | $this->findNamespace(substr($name, 0, $pos)); |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | |
664 | 664 | if ($alternatives = $this->findAlternatives($name, $allCommands)) { |
665 | 665 | // remove hidden commands |
666 | - $alternatives = array_filter($alternatives, function ($name) { |
|
666 | + $alternatives = array_filter($alternatives, function($name) { |
|
667 | 667 | return !$this->get($name)->isHidden(); |
668 | 668 | }); |
669 | 669 | |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | // filter out aliases for commands which are already on the list |
682 | 682 | if (\count($commands) > 1) { |
683 | 683 | $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; |
684 | - $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { |
|
684 | + $commands = array_unique(array_filter($commands, function($nameOrAlias) use (&$commandList, $commands, &$aliases) { |
|
685 | 685 | if (!$commandList[$nameOrAlias] instanceof Command) { |
686 | 686 | $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); |
687 | 687 | } |
@@ -701,16 +701,16 @@ discard block |
||
701 | 701 | foreach ($abbrevs as $abbrev) { |
702 | 702 | $maxLen = max(Helper::width($abbrev), $maxLen); |
703 | 703 | } |
704 | - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { |
|
704 | + $abbrevs = array_map(function($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { |
|
705 | 705 | if ($commandList[$cmd]->isHidden()) { |
706 | 706 | unset($commands[array_search($cmd, $commands)]); |
707 | 707 | |
708 | 708 | return false; |
709 | 709 | } |
710 | 710 | |
711 | - $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); |
|
711 | + $abbrev = str_pad($cmd, $maxLen, ' ') . ' ' . $commandList[$cmd]->getDescription(); |
|
712 | 712 | |
713 | - return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; |
|
713 | + return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3) . '...' : $abbrev; |
|
714 | 714 | }, array_values($commands)); |
715 | 715 | |
716 | 716 | if (\count($commands) > 1) { |
@@ -809,15 +809,15 @@ discard block |
||
809 | 809 | $message = trim($e->getMessage()); |
810 | 810 | if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |
811 | 811 | $class = get_debug_type($e); |
812 | - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); |
|
812 | + $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' (' . $code . ')' : ''); |
|
813 | 813 | $len = Helper::width($title); |
814 | 814 | } else { |
815 | 815 | $len = 0; |
816 | 816 | } |
817 | 817 | |
818 | 818 | if (false !== strpos($message, "@anonymous\0")) { |
819 | - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { |
|
820 | - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; |
|
819 | + $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function($m) { |
|
820 | + return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class') . '@anonymous' : $m[0]; |
|
821 | 821 | }, $message); |
822 | 822 | } |
823 | 823 | |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | $file = $trace[$i]['file'] ?? 'n/a'; |
870 | 870 | $line = $trace[$i]['line'] ?? 'n/a'; |
871 | 871 | |
872 | - $output->writeln(sprintf(' %s%s at <info>%s:%s</info>', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); |
|
872 | + $output->writeln(sprintf(' %s%s at <info>%s:%s</info>', $class, $function ? $type . $function . '()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); |
|
873 | 873 | } |
874 | 874 | |
875 | 875 | $output->writeln('', OutputInterface::VERBOSITY_QUIET); |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | $input->setInteractive(false); |
893 | 893 | } |
894 | 894 | |
895 | - switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { |
|
895 | + switch ($shellVerbosity = (int)getenv('SHELL_VERBOSITY')) { |
|
896 | 896 | case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break; |
897 | 897 | case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break; |
898 | 898 | case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break; |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | } |
922 | 922 | |
923 | 923 | if (\function_exists('putenv')) { |
924 | - @putenv('SHELL_VERBOSITY='.$shellVerbosity); |
|
924 | + @putenv('SHELL_VERBOSITY=' . $shellVerbosity); |
|
925 | 925 | } |
926 | 926 | $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; |
927 | 927 | $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; |
@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | foreach ($this->signalsToDispatchEvent as $signal) { |
953 | 953 | $event = new ConsoleSignalEvent($command, $input, $output, $signal); |
954 | 954 | |
955 | - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { |
|
955 | + $this->signalRegistry->register($signal, function($signal, $hasNext) use ($event) { |
|
956 | 956 | $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); |
957 | 957 | |
958 | 958 | // No more handlers, we try to simulate PHP default behavior |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | { |
1033 | 1033 | return new InputDefinition([ |
1034 | 1034 | new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), |
1035 | - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the <info>'.$this->defaultCommand.'</info> command'), |
|
1035 | + new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the <info>' . $this->defaultCommand . '</info> command'), |
|
1036 | 1036 | new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), |
1037 | 1037 | new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), |
1038 | 1038 | new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | */ |
1072 | 1072 | private function getAbbreviationSuggestions(array $abbrevs): string |
1073 | 1073 | { |
1074 | - return ' '.implode("\n ", $abbrevs); |
|
1074 | + return ' ' . implode("\n ", $abbrevs); |
|
1075 | 1075 | } |
1076 | 1076 | |
1077 | 1077 | /** |
@@ -1130,7 +1130,7 @@ discard block |
||
1130 | 1130 | } |
1131 | 1131 | } |
1132 | 1132 | |
1133 | - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); |
|
1133 | + $alternatives = array_filter($alternatives, function($lev) use ($threshold) { return $lev < 2 * $threshold; }); |
|
1134 | 1134 | ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); |
1135 | 1135 | |
1136 | 1136 | return array_keys($alternatives); |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | |
1183 | 1183 | foreach (preg_split('//u', $m[0]) as $char) { |
1184 | 1184 | // test if $char could be appended to current line |
1185 | - if (mb_strwidth($line.$char, 'utf8') <= $width) { |
|
1185 | + if (mb_strwidth($line . $char, 'utf8') <= $width) { |
|
1186 | 1186 | $line .= $char; |
1187 | 1187 | continue; |
1188 | 1188 | } |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | |
1213 | 1213 | foreach ($parts as $part) { |
1214 | 1214 | if (\count($namespaces)) { |
1215 | - $namespaces[] = end($namespaces).':'.$part; |
|
1215 | + $namespaces[] = end($namespaces) . ':' . $part; |
|
1216 | 1216 | } else { |
1217 | 1217 | $namespaces[] = $part; |
1218 | 1218 | } |
@@ -360,10 +360,10 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); |
363 | - $prevPeriod = (int) ($this->step / $redrawFreq); |
|
364 | - $currPeriod = (int) ($step / $redrawFreq); |
|
363 | + $prevPeriod = (int)($this->step / $redrawFreq); |
|
364 | + $currPeriod = (int)($step / $redrawFreq); |
|
365 | 365 | $this->step = $step; |
366 | - $this->percent = $this->max ? (float) $this->step / $this->max : 0; |
|
366 | + $this->percent = $this->max ? (float)$this->step / $this->max : 0; |
|
367 | 367 | $timeInterval = microtime(true) - $this->lastWriteTime; |
368 | 368 | |
369 | 369 | // Draw regardless of other limits |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | { |
389 | 389 | $this->format = null; |
390 | 390 | $this->max = max(0, $max); |
391 | - $this->stepWidth = $this->max ? Helper::width((string) $this->max) : 4; |
|
391 | + $this->stepWidth = $this->max ? Helper::width((string)$this->max) : 4; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | private function setRealFormat(string $format) |
448 | 448 | { |
449 | 449 | // try to use the _nomax variant if available |
450 | - if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { |
|
451 | - $this->format = self::getFormatDefinition($format.'_nomax'); |
|
450 | + if (!$this->max && null !== self::getFormatDefinition($format . '_nomax')) { |
|
451 | + $this->format = self::getFormatDefinition($format . '_nomax'); |
|
452 | 452 | } elseif (null !== self::getFormatDefinition($format)) { |
453 | 453 | $this->format = self::getFormatDefinition($format); |
454 | 454 | } else { |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | } |
492 | 492 | } |
493 | 493 | } elseif ($this->step > 0) { |
494 | - $message = \PHP_EOL.$message; |
|
494 | + $message = \PHP_EOL . $message; |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | $this->previousMessage = $originalMessage; |
@@ -519,43 +519,43 @@ discard block |
||
519 | 519 | private static function initPlaceholderFormatters(): array |
520 | 520 | { |
521 | 521 | return [ |
522 | - 'bar' => function (self $bar, OutputInterface $output) { |
|
522 | + 'bar' => function(self $bar, OutputInterface $output) { |
|
523 | 523 | $completeBars = $bar->getBarOffset(); |
524 | 524 | $display = str_repeat($bar->getBarCharacter(), $completeBars); |
525 | 525 | if ($completeBars < $bar->getBarWidth()) { |
526 | 526 | $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); |
527 | - $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); |
|
527 | + $display .= $bar->getProgressCharacter() . str_repeat($bar->getEmptyBarCharacter(), $emptyBars); |
|
528 | 528 | } |
529 | 529 | |
530 | 530 | return $display; |
531 | 531 | }, |
532 | - 'elapsed' => function (self $bar) { |
|
532 | + 'elapsed' => function(self $bar) { |
|
533 | 533 | return Helper::formatTime(time() - $bar->getStartTime()); |
534 | 534 | }, |
535 | - 'remaining' => function (self $bar) { |
|
535 | + 'remaining' => function(self $bar) { |
|
536 | 536 | if (!$bar->getMaxSteps()) { |
537 | 537 | throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); |
538 | 538 | } |
539 | 539 | |
540 | 540 | return Helper::formatTime($bar->getRemaining()); |
541 | 541 | }, |
542 | - 'estimated' => function (self $bar) { |
|
542 | + 'estimated' => function(self $bar) { |
|
543 | 543 | if (!$bar->getMaxSteps()) { |
544 | 544 | throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); |
545 | 545 | } |
546 | 546 | |
547 | 547 | return Helper::formatTime($bar->getEstimated()); |
548 | 548 | }, |
549 | - 'memory' => function (self $bar) { |
|
549 | + 'memory' => function(self $bar) { |
|
550 | 550 | return Helper::formatMemory(memory_get_usage(true)); |
551 | 551 | }, |
552 | - 'current' => function (self $bar) { |
|
552 | + 'current' => function(self $bar) { |
|
553 | 553 | return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); |
554 | 554 | }, |
555 | - 'max' => function (self $bar) { |
|
555 | + 'max' => function(self $bar) { |
|
556 | 556 | return $bar->getMaxSteps(); |
557 | 557 | }, |
558 | - 'percent' => function (self $bar) { |
|
558 | + 'percent' => function(self $bar) { |
|
559 | 559 | return floor($bar->getProgressPercent() * 100); |
560 | 560 | }, |
561 | 561 | ]; |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | private function buildLine(): string |
582 | 582 | { |
583 | 583 | $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; |
584 | - $callback = function ($matches) { |
|
584 | + $callback = function($matches) { |
|
585 | 585 | if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { |
586 | 586 | $text = $formatter($this, $this->output); |
587 | 587 | } elseif (isset($this->messages[$matches[1]])) { |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | } |
592 | 592 | |
593 | 593 | if (isset($matches[2])) { |
594 | - $text = sprintf('%'.$matches[2], $text); |
|
594 | + $text = sprintf('%' . $matches[2], $text); |
|
595 | 595 | } |
596 | 596 | |
597 | 597 | return $text; |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | $line = preg_replace_callback($regex, $callback, $this->format); |
600 | 600 | |
601 | 601 | // gets string length for each sub line with multiline format |
602 | - $linesLength = array_map(function ($subLine) { |
|
602 | + $linesLength = array_map(function($subLine) { |
|
603 | 603 | return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); |
604 | 604 | }, explode("\n", $line)); |
605 | 605 |
@@ -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 | /** |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | return; |
180 | 180 | } |
181 | 181 | |
182 | - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { |
|
182 | + $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function($matches) { |
|
183 | 183 | if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { |
184 | 184 | return $formatter($this); |
185 | 185 | } |
@@ -223,16 +223,16 @@ discard block |
||
223 | 223 | private static function initPlaceholderFormatters(): array |
224 | 224 | { |
225 | 225 | return [ |
226 | - 'indicator' => function (self $indicator) { |
|
226 | + 'indicator' => function(self $indicator) { |
|
227 | 227 | return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; |
228 | 228 | }, |
229 | - 'message' => function (self $indicator) { |
|
229 | + 'message' => function(self $indicator) { |
|
230 | 230 | return $indicator->message; |
231 | 231 | }, |
232 | - 'elapsed' => function (self $indicator) { |
|
232 | + 'elapsed' => function(self $indicator) { |
|
233 | 233 | return Helper::formatTime(time() - $indicator->startTime); |
234 | 234 | }, |
235 | - 'memory' => function () { |
|
235 | + 'memory' => function() { |
|
236 | 236 | return Helper::formatMemory(memory_get_usage(true)); |
237 | 237 | }, |
238 | 238 | ]; |
@@ -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 | } |
@@ -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 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function getColspan() |
60 | 60 | { |
61 | - return (int) $this->options['colspan']; |
|
61 | + return (int)$this->options['colspan']; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function getRowspan() |
70 | 70 | { |
71 | - return (int) $this->options['rowspan']; |
|
71 | + return (int)$this->options['rowspan']; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function getStyle(): ?TableCellStyle |
@@ -439,14 +439,14 @@ discard block |
||
439 | 439 | if ($titleLength > $limit = $markupLength - 4) { |
440 | 440 | $titleLength = $limit; |
441 | 441 | $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); |
442 | - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); |
|
442 | + $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3) . '...'); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | $titleStart = ($markupLength - $titleLength) / 2; |
446 | 446 | if (false === mb_detect_encoding($markup, null, true)) { |
447 | 447 | $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); |
448 | 448 | } else { |
449 | - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); |
|
449 | + $markup = mb_substr($markup, 0, $titleStart) . $formattedTitle . mb_substr($markup, $titleStart + $titleLength); |
|
450 | 450 | } |
451 | 451 | } |
452 | 452 | |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $cellFormat = $cell->getStyle()->getCellFormat(); |
522 | 522 | if (!\is_string($cellFormat)) { |
523 | 523 | $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); |
524 | - $cellFormat = '<'.$tag.'>%s</>'; |
|
524 | + $cellFormat = '<' . $tag . '>%s</>'; |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | if (strstr($content, '</>')) { |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | } |
595 | 595 | } |
596 | 596 | |
597 | - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { |
|
597 | + return new TableRows(function() use ($rows, $unmergedRows): \Traversable { |
|
598 | 598 | foreach ($rows as $rowKey => $row) { |
599 | 599 | yield $this->fillCells($row); |
600 | 600 |
@@ -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, $this->tagOptions) && isset($this->options[$key]); |
72 | 72 | }, |
73 | 73 | \ARRAY_FILTER_USE_KEY |