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

[Console] Argument consumption #30244

wants to merge 17 commits into from

Conversation

Guikingone
Copy link
Contributor

@Guikingone Guikingone commented Feb 14, 2019

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #23343
License MIT
Doc PR

Hi everyone,

This PR is linked to #23343, as explained by @nicolas-grekas, a new argument has been added in order to remove the parameter if needed.

Tests should be completed (in progress), same things for the code (not every case are covered).

@chalasr chalasr added this to the next milestone Feb 14, 2019
@@ -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

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

thanks, some comments to help move forward.

[['app/console', 'foo:bar', '-e', 'dev'], '-e', false, false, 'dev'],
[['app/console', 'foo:bar', '-e', 'dev'], '-e', false, true, ''],
[['app/console', 'foo:bar', '-e', 'dev', '-f', 'bar'], ['-e', '-f'], false, false, 'dev'],
[['app/console', 'foo:bar', '-e', 'dev', '-f', 'bar'], ['-e', '-f'], false, true, ''],
Copy link
Member

Choose a reason for hiding this comment

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

when consume is true, the first call should return true, and the next ones should return false, because the first call "consumed" the info

[['app/console', 'foo:bar', '-e', 'dev', '--foo', 'bar'], '-f', false, false, ''],
[['app/console', 'foo:bar', '-e', 'dev', '--foo', 'bar'], '-f', false, true, ''],
[['app/console', 'foo:bar', '-e', 'dev', '--foo', 'bar'], '--foo', false, false, 'bar'],
[['app/console', 'foo:bar', '-e', 'dev', '--foo', 'bar'], '-f', false, true, ''],
Copy link
Member

Choose a reason for hiding this comment

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

there are move ways to set the dev env: --env=dev and --env dev - we should test them all, not only -e dev

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Feb 16, 2019

please rebase also, there are unrelated commits in the current history.

@nicolas-grekas nicolas-grekas changed the title [CONSOLE] Argument consumption [Console] Argument consumption Mar 7, 2019
@nicolas-grekas
Copy link
Member

Closing as the current approach is not the correct one and this is stalling, I'll take over, thanks for trying!

@nicolas-grekas nicolas-grekas removed this from the next milestone Apr 30, 2019
@nicolas-grekas nicolas-grekas added this to the 4.3 milestone Apr 30, 2019
@Guikingone Guikingone deleted the fix/console-arg branch October 3, 2020 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.