-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix --complete flag in orm:ensure-production-settings command #8426
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0143001
Fix ensure production settings command without connection
alexander-schranz 876733e
Use not complete instead of check for false or null
alexander-schranz 6a060aa
Fix code style
alexander-schranz 9a0cc88
Use typesafe check for complete inputOption
alexander-schranz 1b24297
Add testcase for ensure production settings command
alexander-schranz 0025331
Fix code style
alexander-schranz 50ccad7
Use DoctrineTestCase instead of OrmTestCase
alexander-schranz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current symfony returns
false
not sure ifnull
was returned in older version so I did switch to using!
instead for checking for false or null.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a default value that can be set in
addOption
. Without an explicit value it isnull
.https://github.com/symfony/console/blob/5.x/Command/Command.php#L400
It seems to be the same in 4.0 and 3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like its not possible to set a default value for InputOption::VALUE_NONE: https://github.com/symfony/console/blob/356c70659d6b48595f9f275cd7c4de0d5544c49c/Input/InputOption.php#L168
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I could go with:
or the current version.
The value of the input is set here to
true
:https://github.com/symfony/console/blob/356c70659d6b48595f9f275cd7c4de0d5544c49c/Input/ArgvInput.php#L248
And default value to
false
:https://github.com/symfony/console/blob/356c70659d6b48595f9f275cd7c4de0d5544c49c/Input/InputOption.php#L182
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a boolean then your current syntax should fit. You currently let it step into the if-block when the value is
false
. It also looks like there are no tests yet that covers this class. Can you please create one that covers your changes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SenseException created the missing test class hope it matches how tests are created in this repository.