@@ -59,7 +59,7 @@ |
||
| 59 | 59 | |
| 60 | 60 | $messages = $large ? array(str_repeat(' ', $len)) : array(); |
| 61 | 61 | for ($i = 0; isset($lines[$i]); ++$i) { |
| 62 | - $messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i])); |
|
| 62 | + $messages[] = $lines[$i] . str_repeat(' ', $len - $this->strlen($lines[$i])); |
|
| 63 | 63 | } |
| 64 | 64 | if ($large) { |
| 65 | 65 | $messages[] = str_repeat(' ', $len); |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | return $format[1]; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - return ceil($secs / $format[2]).' '.$format[1]; |
|
| 88 | + return ceil($secs / $format[2]) . ' ' . $format[1]; |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -416,7 +416,7 @@ |
||
| 416 | 416 | $text = $format[1]; |
| 417 | 417 | break; |
| 418 | 418 | } else { |
| 419 | - $text = ceil($secs / $format[2]).' '.$format[1]; |
|
| 419 | + $text = ceil($secs / $format[2]) . ' ' . $format[1]; |
|
| 420 | 420 | break; |
| 421 | 421 | } |
| 422 | 422 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $that = $this; |
| 53 | 53 | |
| 54 | - $interviewer = function () use ($output, $question, $that) { |
|
| 54 | + $interviewer = function() use ($output, $question, $that) { |
|
| 55 | 55 | return $that->doAsk($output, $question); |
| 56 | 56 | }; |
| 57 | 57 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | // Save cursor position |
| 267 | 267 | $output->write("\0337"); |
| 268 | 268 | // Write highlighted text |
| 269 | - $output->write('<hl>'.substr($matches[$ofs], $i).'</hl>'); |
|
| 269 | + $output->write('<hl>' . substr($matches[$ofs], $i) . '</hl>'); |
|
| 270 | 270 | // Restore cursor position |
| 271 | 271 | $output->write("\0338"); |
| 272 | 272 | } |
@@ -290,11 +290,11 @@ discard block |
||
| 290 | 290 | private function getHiddenResponse(OutputInterface $output, $inputStream) |
| 291 | 291 | { |
| 292 | 292 | if ('\\' === DIRECTORY_SEPARATOR) { |
| 293 | - $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; |
|
| 293 | + $exe = __DIR__ . '/../Resources/bin/hiddeninput.exe'; |
|
| 294 | 294 | |
| 295 | 295 | // handle code running from a phar |
| 296 | 296 | if ('phar:' === substr(__FILE__, 0, 5)) { |
| 297 | - $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; |
|
| 297 | + $tmpExe = sys_get_temp_dir() . '/hiddeninput.exe'; |
|
| 298 | 298 | copy($exe, $tmpExe); |
| 299 | 299 | $exe = $tmpExe; |
| 300 | 300 | } |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { |
| 359 | 359 | $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); |
| 360 | 360 | } else { |
| 361 | - $message = '<error>'.$error->getMessage().'</error>'; |
|
| 361 | + $message = '<error>' . $error->getMessage() . '</error>'; |
|
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | $output->writeln($message); |
@@ -258,7 +258,7 @@ |
||
| 258 | 258 | |
| 259 | 259 | $markup = $this->style->getCrossingChar(); |
| 260 | 260 | for ($column = 0; $column < $count; $column++) { |
| 261 | - $markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->getColumnWidth($column)).$this->style->getCrossingChar(); |
|
| 261 | + $markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->getColumnWidth($column)) . $this->style->getCrossingChar(); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | foreach ($this->tokens as $token) { |
| 288 | 288 | foreach ($values as $value) { |
| 289 | - if ($token === $value || 0 === strpos($token, $value.'=')) { |
|
| 289 | + if ($token === $value || 0 === strpos($token, $value . '=')) { |
|
| 290 | 290 | return true; |
| 291 | 291 | } |
| 292 | 292 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $token = array_shift($tokens); |
| 316 | 316 | |
| 317 | 317 | foreach ($values as $value) { |
| 318 | - if ($token === $value || 0 === strpos($token, $value.'=')) { |
|
| 318 | + if ($token === $value || 0 === strpos($token, $value . '=')) { |
|
| 319 | 319 | if (false !== $pos = strpos($token, '=')) { |
| 320 | 320 | return substr($token, $pos + 1); |
| 321 | 321 | } |
@@ -336,9 +336,9 @@ discard block |
||
| 336 | 336 | public function __toString() |
| 337 | 337 | { |
| 338 | 338 | $self = $this; |
| 339 | - $tokens = array_map(function ($token) use ($self) { |
|
| 339 | + $tokens = array_map(function($token) use ($self) { |
|
| 340 | 340 | if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { |
| 341 | - return $match[1].$self->escapeToken($match[2]); |
|
| 341 | + return $match[1] . $self->escapeToken($match[2]); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | if ($token && $token[0] !== '-') { |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | $params = array(); |
| 123 | 123 | foreach ($this->parameters as $param => $val) { |
| 124 | 124 | if ($param && '-' === $param[0]) { |
| 125 | - $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); |
|
| 125 | + $params[] = $param . ('' != $val ? '=' . $this->escapeToken($val) : ''); |
|
| 126 | 126 | } else { |
| 127 | 127 | $params[] = $this->escapeToken($val); |
| 128 | 128 | } |
@@ -398,11 +398,11 @@ |
||
| 398 | 398 | $elements = array(); |
| 399 | 399 | foreach ($this->getOptions() as $option) { |
| 400 | 400 | $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; |
| 401 | - $elements[] = sprintf('['.($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')).']', $shortcut, $option->getName()); |
|
| 401 | + $elements[] = sprintf('[' . ($option->isValueRequired() ? '%s--%s="..."' : ($option->isValueOptional() ? '%s--%s[="..."]' : '%s--%s')) . ']', $shortcut, $option->getName()); |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | foreach ($this->getArguments() as $argument) { |
| 405 | - $elements[] = sprintf($argument->isRequired() ? '%s' : '[%s]', $argument->getName().($argument->isArray() ? '1' : '')); |
|
| 405 | + $elements[] = sprintf($argument->isRequired() ? '%s' : '[%s]', $argument->getName() . ($argument->isArray() ? '1' : '')); |
|
| 406 | 406 | |
| 407 | 407 | if ($argument->isArray()) { |
| 408 | 408 | $elements[] = sprintf('... [%sN]', $argument->getName()); |
@@ -64,11 +64,11 @@ |
||
| 64 | 64 | $cursor = 0; |
| 65 | 65 | while ($cursor < $length) { |
| 66 | 66 | if (preg_match('/\s+/A', $input, $match, null, $cursor)) { |
| 67 | - } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) { |
|
| 68 | - $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2))); |
|
| 69 | - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) { |
|
| 67 | + } elseif (preg_match('/([^="\'\s]+?)(=?)(' . self::REGEX_QUOTED_STRING . '+)/A', $input, $match, null, $cursor)) { |
|
| 68 | + $tokens[] = $match[1] . $match[2] . stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2))); |
|
| 69 | + } elseif (preg_match('/' . self::REGEX_QUOTED_STRING . '/A', $input, $match, null, $cursor)) { |
|
| 70 | 70 | $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2)); |
| 71 | - } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) { |
|
| 71 | + } elseif (preg_match('/' . self::REGEX_STRING . '/A', $input, $match, null, $cursor)) { |
|
| 72 | 72 | $tokens[] = stripcslashes($match[1]); |
| 73 | 73 | } else { |
| 74 | 74 | // should never happen |