Merge branch '4.4' into 5.2

* 4.4:
  [Console] fix type annotations on InputInterface
This commit is contained in:
Nicolas Grekas 2021-07-02 19:00:48 +02:00
commit 23af8dab8c
2 changed files with 8 additions and 5 deletions

View File

@ -104,7 +104,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
/**
* {@inheritdoc}
*/
public function getArgument(string $name)
public function getArgument($name)
{
if (!$this->definition->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
@ -116,7 +116,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
/**
* {@inheritdoc}
*/
public function setArgument(string $name, $value)
public function setArgument($name, $value)
{
if (!$this->definition->hasArgument($name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));

View File

@ -83,20 +83,23 @@ interface InputInterface
/**
* Returns the argument value for a given argument name.
*
* @param string|int $name The InputArgument name or position
*
* @return mixed
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
public function getArgument(string $name);
public function getArgument($name);
/**
* Sets an argument value by name.
*
* @param mixed $value The argument value
* @param string|int $name The InputArgument name or position
* @param mixed $value The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
public function setArgument(string $name, $value);
public function setArgument($name, $value);
/**
* Returns true if an InputArgument object exists by name or position.