Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console] Revert "bug #41952 fix handling positional arguments" #41966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[Console] Fix type annotation on InputInterface::hasArgument()
  • Loading branch information
nicolas-grekas committed Jul 4, 2021
commit 6ac2776c470fb0e3d7207987ccd9c464a7e52dad
6 changes: 3 additions & 3 deletions 6 src/Symfony/Component/Console/Input/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function getArguments()
*/
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));
}

Expand All @@ -118,7 +118,7 @@ public function getArgument($name)
*/
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));
}

Expand All @@ -130,7 +130,7 @@ public function setArgument($name, $value)
*/
public function hasArgument($name)
{
return $this->definition->hasArgument($name);
return $this->definition->hasArgument((string) $name);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Console/Input/InputInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function setArgument($name, $value);
/**
* 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
*/
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.