You are here

public function ArrayInput::__toString in Zircon Profile 8

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

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

Return value

string

File

vendor/symfony/console/Input/ArrayInput.php, line 116

Class

ArrayInput
ArrayInput represents an input provided as an array.

Namespace

Symfony\Component\Console\Input

Code

public function __toString() {
  $params = array();
  foreach ($this->parameters as $param => $val) {
    if ($param && '-' === $param[0]) {
      $params[] = $param . ('' != $val ? '=' . $this
        ->escapeToken($val) : '');
    }
    else {
      $params[] = $this
        ->escapeToken($val);
    }
  }
  return implode(' ', $params);
}