Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ArgvInput.php

function ArgvInput::__toString

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

Overrides InputInterface::__toString

1 method overrides ArgvInput::__toString()
CompletionInput::__toString in vendor/symfony/console/Completion/CompletionInput.php
Returns a stringified representation of the args passed to the command.

File

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

Class

ArgvInput
ArgvInput represents an input coming from the CLI arguments.

Namespace

Symfony\Component\Console\Input

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal