Dep: update

주로 PHAN
This commit is contained in:
2021-08-06 22:39:09 +09:00
parent 5310c2e7f6
commit b306601c72
1098 changed files with 92137 additions and 33228 deletions
+16 -4
View File
@@ -110,7 +110,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault();
return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault();
}
/**
@@ -128,7 +128,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
/**
* {@inheritdoc}
*/
public function hasArgument($name)
public function hasArgument(string $name)
{
return $this->definition->hasArgument($name);
}
@@ -146,6 +146,14 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function getOption(string $name)
{
if ($this->definition->hasNegation($name)) {
if (null === $value = $this->getOption($this->definition->negationToName($name))) {
return $value;
}
return !$value;
}
if (!$this->definition->hasOption($name)) {
throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
}
@@ -158,7 +166,11 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function setOption(string $name, $value)
{
if (!$this->definition->hasOption($name)) {
if ($this->definition->hasNegation($name)) {
$this->options[$this->definition->negationToName($name)] = !$value;
return;
} elseif (!$this->definition->hasOption($name)) {
throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
}
@@ -170,7 +182,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function hasOption(string $name)
{
return $this->definition->hasOption($name);
return $this->definition->hasOption($name) || $this->definition->hasNegation($name);
}
/**