From 6ac2776c470fb0e3d7207987ccd9c464a7e52dad Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 4 Jul 2021 11:08:18 +0200 Subject: [PATCH] [Console] Fix type annotation on InputInterface::hasArgument() --- src/Symfony/Component/Console/Input/Input.php | 6 +++--- src/Symfony/Component/Console/Input/InputInterface.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Input/Input.php b/src/Symfony/Component/Console/Input/Input.php index 6e4c01e95f..d7f29073e5 100644 --- a/src/Symfony/Component/Console/Input/Input.php +++ b/src/Symfony/Component/Console/Input/Input.php @@ -106,7 +106,7 @@ abstract class Input implements InputInterface, StreamableInputInterface */ public function getArgument($name) { - if (!$this->definition->hasArgument($name)) { + if (!$this->definition->hasArgument((string) $name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } @@ -118,7 +118,7 @@ abstract class Input implements InputInterface, StreamableInputInterface */ public function setArgument($name, $value) { - if (!$this->definition->hasArgument($name)) { + if (!$this->definition->hasArgument((string) $name)) { throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } @@ -130,7 +130,7 @@ abstract class Input implements InputInterface, StreamableInputInterface */ public function hasArgument($name) { - return $this->definition->hasArgument($name); + return $this->definition->hasArgument((string) $name); } /** diff --git a/src/Symfony/Component/Console/Input/InputInterface.php b/src/Symfony/Component/Console/Input/InputInterface.php index 4ecab0f4fb..5d0db5c188 100644 --- a/src/Symfony/Component/Console/Input/InputInterface.php +++ b/src/Symfony/Component/Console/Input/InputInterface.php @@ -104,7 +104,7 @@ interface InputInterface /** * Returns true if an InputArgument object exists by name or position. * - * @param string|int $name The InputArgument name or position + * @param string $name The InputArgument name or position * * @return bool true if the InputArgument object exists, false otherwise */