-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Add ability to regress the ProgressBar #19824
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
[Console] Add ability to regress the ProgressBar #19824
Conversation
jameshalsall
commented
Sep 2, 2016
•
edited
Loading
edited
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #15227 |
License | MIT |
Doc PR | https://github.com/symfony/symfony-docs/pull/6949/files |
The build failure in AppVeyor does not look related to these changes. |
* | ||
* @param int $step Number of steps to regress | ||
*/ | ||
public function regress($step = 1) |
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.
I think we don't need a new method. What about just allowing negative numbers for advance?
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.
We could do that, but that sounds like an oxymoron calling advance()
to actually step backwards, adding regress()
at least keeps the API consistent
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.
But it would keep it consistent with the progress property too, although I'm fine with both, I don't see anything shocking about using negative here.
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.
I prefer a clean API with simple, straight-forward methods, myself.
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.
Then, we need an exception in advance
when used with a negative number and another one in regress
when used with a negative number as well.
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.
An exception would be a DX issue, forcing one to call the correct method with boilerplate just for the sign. I agree with the first comment, we need only progress.
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.
This has now been updated so there is no regress()
method.
ceecd00
to
42971bb
Compare
Thank you @jameshalsall. |
…shalsall) This PR was merged into the 3.2-dev branch. Discussion ---------- [Console] Add ability to regress the ProgressBar | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15227 | License | MIT | Doc PR | https://github.com/symfony/symfony-docs/pull/6949/files Commits ------- 42971bb [Console] Add ability to regress the ProgressBar
…halsall) This PR was squashed before being merged into the master branch (closes #6949). Discussion ---------- Update ProgressBar docs with regress information Doc updates for changes introduced in symfony/symfony#19824 Commits ------- d3346d8 Update ProgressBar docs with regress information