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] Argument consumption #30244

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

Closed
wants to merge 17 commits into from
Closed
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
Next Next commit
fix(component): Console -> argument consumption
A new argument has been added in order to consume or not the argument.
  • Loading branch information
Guikingone committed Feb 14, 2019
commit 3039f631746f13b4decd407e8bd25edfca04489d
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/Console/Input/ArgvInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function hasParameterOption($values, $onlyParams = false)
/**
* {@inheritdoc}
*/
public function getParameterOption($values, $default = false, $onlyParams = false)
public function getParameterOption($values, $default = false, $onlyParams = false, $consume = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this class should be changed: all the other changes should be reverted as they are unneeded BC breaks.
On this class, the argument should be commented, mentionned in the docblock and accessed using func_get_arg().
See eg https://github.com/symfony/symfony/pull/30212/files#diff-94f4ef2d14dbabcc4f9c798fea31defbR350

{
$values = (array) $values;
$tokens = $this->tokens;
Expand Down
3 changes: 2 additions & 1 deletion 3 src/Symfony/Component/Console/Input/InputInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ public function hasParameterOption($values, $onlyParams = false);
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
* @param mixed $default The default value to return if no result is found
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
* @param bool $consume If true, the corresponding parameter will be removed from the instance
*
* @return mixed The option value
*/
public function getParameterOption($values, $default = false, $onlyParams = false);
public function getParameterOption($values, $default = false, $onlyParams = false, $consume = false);

/**
* Binds the current Input instance with the given arguments and options.
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.