Skip to content

[Console] Add placeholder formatters per ProgressBar instance #17638

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

Conversation

alexandre-daubois
Copy link
Member

Resolves #17545

$progressBar->setPlaceholderFormatter('countdown', function (ProgressBar $progressBar) {
return $progressBar->getMaxSteps() - $progressBar->getProgress();
});

Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably add

.. versionadded:: 6.3

    The ``setPlaceholderFormatter()`` method was introduced in Symfony 6.3.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought of this, but wasn't sure! Do you know if there is any "rule" to it, when to add it or not?

Copy link
Member

Choose a reason for hiding this comment

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

@alexandre-daubois we add the versionadded directive for any new option, method, class, feature, etc. added to Symfony. We also have the deprecated directive to do the opposite.

@alexandre-daubois alexandre-daubois force-pushed the progressbar-placeholder-formatter branch from 7f158ac to 54d88e1 Compare January 2, 2023 07:46
@javiereguiluz
Copy link
Member

Thanks Alexandre.

@javiereguiluz javiereguiluz merged commit 790a4ae into symfony:6.3 Jan 3, 2023
@alexandre-daubois alexandre-daubois deleted the progressbar-placeholder-formatter branch January 3, 2023 17:30
@GromNaN
Copy link
Member

GromNaN commented Jan 3, 2023

Thank you.

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.

6 participants