composer update, composer corelibs update, admin pages update
This commit is contained in:
29
vendor/symfony/console/Input/Input.php
vendored
29
vendor/symfony/console/Input/Input.php
vendored
@@ -43,6 +43,9 @@ abstract class Input implements InputInterface, StreamableInputInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function bind(InputDefinition $definition)
|
||||
{
|
||||
$this->arguments = [];
|
||||
@@ -54,17 +57,20 @@ abstract class Input implements InputInterface, StreamableInputInterface
|
||||
|
||||
/**
|
||||
* Processes command line arguments.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
abstract protected function parse();
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function validate()
|
||||
{
|
||||
$definition = $this->definition;
|
||||
$givenArguments = $this->arguments;
|
||||
|
||||
$missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) {
|
||||
return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired();
|
||||
});
|
||||
$missingArguments = array_filter(array_keys($definition->getArguments()), fn ($argument) => !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired());
|
||||
|
||||
if (\count($missingArguments) > 0) {
|
||||
throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments)));
|
||||
@@ -76,6 +82,9 @@ abstract class Input implements InputInterface, StreamableInputInterface
|
||||
return $this->interactive;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setInteractive(bool $interactive)
|
||||
{
|
||||
$this->interactive = $interactive;
|
||||
@@ -95,6 +104,9 @@ abstract class Input implements InputInterface, StreamableInputInterface
|
||||
return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setArgument(string $name, mixed $value)
|
||||
{
|
||||
if (!$this->definition->hasArgument($name)) {
|
||||
@@ -131,6 +143,9 @@ abstract class Input implements InputInterface, StreamableInputInterface
|
||||
return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function setOption(string $name, mixed $value)
|
||||
{
|
||||
if ($this->definition->hasNegation($name)) {
|
||||
@@ -157,11 +172,19 @@ abstract class Input implements InputInterface, StreamableInputInterface
|
||||
return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource $stream
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setStream($stream)
|
||||
{
|
||||
$this->stream = $stream;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return resource
|
||||
*/
|
||||
public function getStream()
|
||||
{
|
||||
return $this->stream;
|
||||
|
||||
Reference in New Issue
Block a user