Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
19
vendor/symfony/console/Input/ArrayInput.php
vendored
19
vendor/symfony/console/Input/ArrayInput.php
vendored
|
|
@ -11,6 +11,9 @@
|
|||
|
||||
namespace Symfony\Component\Console\Input;
|
||||
|
||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Console\Exception\InvalidOptionException;
|
||||
|
||||
/**
|
||||
* ArrayInput represents an input provided as an array.
|
||||
*
|
||||
|
|
@ -149,12 +152,12 @@ class ArrayInput extends Input
|
|||
* @param string $shortcut The short option key
|
||||
* @param mixed $value The value for the option
|
||||
*
|
||||
* @throws \InvalidArgumentException When option given doesn't exist
|
||||
* @throws InvalidOptionException When option given doesn't exist
|
||||
*/
|
||||
private function addShortOption($shortcut, $value)
|
||||
{
|
||||
if (!$this->definition->hasShortcut($shortcut)) {
|
||||
throw new \InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
|
||||
throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut));
|
||||
}
|
||||
|
||||
$this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value);
|
||||
|
|
@ -166,20 +169,20 @@ class ArrayInput extends Input
|
|||
* @param string $name The long option key
|
||||
* @param mixed $value The value for the option
|
||||
*
|
||||
* @throws \InvalidArgumentException When option given doesn't exist
|
||||
* @throws \InvalidArgumentException When a required value is missing
|
||||
* @throws InvalidOptionException When option given doesn't exist
|
||||
* @throws InvalidOptionException When a required value is missing
|
||||
*/
|
||||
private function addLongOption($name, $value)
|
||||
{
|
||||
if (!$this->definition->hasOption($name)) {
|
||||
throw new \InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name));
|
||||
throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name));
|
||||
}
|
||||
|
||||
$option = $this->definition->getOption($name);
|
||||
|
||||
if (null === $value) {
|
||||
if ($option->isValueRequired()) {
|
||||
throw new \InvalidArgumentException(sprintf('The "--%s" option requires a value.', $name));
|
||||
throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name));
|
||||
}
|
||||
|
||||
$value = $option->isValueOptional() ? $option->getDefault() : true;
|
||||
|
|
@ -194,12 +197,12 @@ class ArrayInput extends Input
|
|||
* @param string $name The argument name
|
||||
* @param mixed $value The value for the argument
|
||||
*
|
||||
* @throws \InvalidArgumentException When argument given doesn't exist
|
||||
* @throws InvalidArgumentException When argument given doesn't exist
|
||||
*/
|
||||
private function addArgument($name, $value)
|
||||
{
|
||||
if (!$this->definition->hasArgument($name)) {
|
||||
throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
|
||||
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
|
||||
}
|
||||
|
||||
$this->arguments[$name] = $value;
|
||||
|
|
|
|||
Reference in a new issue