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\InputCode
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);
}