-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Support empty values for options #21215
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
Comments
@fabpot Ok that passing |
See #21228 |
Closing it as "impossible to fix" ... documenting this behavior in symfony/symfony-docs#7363 |
Well, solving the issue of having empty strings when quotes are specified involves to loose Think about our first issue with the |
This should be reopened :) |
@dakess Thanks for confirming that the fix is valid, it's the best help you could give.
I was not aware of this issue, it seems to be a duplicate. Added it to #21228 fixed tickets.
It'll be once merged, then automatically available in next releases. |
…empty) should remain empty (chalasr) This PR was merged into the 3.3-dev branch. Discussion ---------- [Console] Explicitly passed options without value (or empty) should remain empty | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21215 #11572 #12773 | License | MIT | Doc PR | n/a (maybe look at updating the existing one) This conserves empty values for options instead of returning their default values. Code: ```php // cli.php $application = new Application(); $application ->register('echo') ->addOption('prefix', null, InputOption::VALUE_OPTIONAL, null, 'my-default') ->addArgument('value', InputArgument::REQUIRED) ->setCode(function ($input, $output) { var_dump($input->getOption('prefix')); }); $application->run(); ``` Before:  After:  Commits ------- 8086742 [Console] Explicitly passed options without value (or empty) should remain empty
…ions (javiereguiluz) This PR was merged into the 2.7 branch. Discussion ---------- Document that you can't pass empty strings to console options Related to symfony/symfony#21215 Commits ------- 9666907 Document that you can't pass empty strings to console options
Fabien added this comment about this bug:
The text was updated successfully, but these errors were encountered: