You are here

public function ArgvInput::__toString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Input/ArgvInput.php \Symfony\Component\Console\Input\ArgvInput::__toString()

Returns a stringified representation of the args passed to the command.

Return value

string

File

vendor/symfony/console/Input/ArgvInput.php, line 332

Class

ArgvInput
ArgvInput represents an input coming from the CLI arguments.

Namespace

Symfony\Component\Console\Input

Code

public function __toString() {
  $self = $this;
  $tokens = array_map(function ($token) use ($self) {
    if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) {
      return $match[1] . $self
        ->escapeToken($match[2]);
    }
    if ($token && $token[0] !== '-') {
      return $self
        ->escapeToken($token);
    }
    return $token;
  }, $this->tokens);
  return implode(' ', $tokens);
}