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

Breadcrumb

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

function ArgvInput::__construct

Parameters

list<string>|null $argv :

Overrides Input::__construct

2 calls to ArgvInput::__construct()
StringInput::__construct in vendor/symfony/console/Input/StringInput.php
StringInput::__construct in vendor/symfony/console/Input/StringInput.php
1 method overrides ArgvInput::__construct()
StringInput::__construct in vendor/symfony/console/Input/StringInput.php

File

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

Class

ArgvInput
ArgvInput represents an input coming from the CLI arguments.

Namespace

Symfony\Component\Console\Input

Code

public function __construct(?array $argv = null, ?InputDefinition $definition = null) {
    $argv ??= $_SERVER['argv'] ?? [];
    foreach ($argv as $arg) {
        if (!\is_scalar($arg) && !$arg instanceof \Stringable) {
            throw new RuntimeException(\sprintf('Argument values expected to be all scalars, got "%s".', get_debug_type($arg)));
        }
    }
    // strip the application name
    array_shift($argv);
    $this->tokens = $argv;
    parent::__construct($definition);
}

API Navigation

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