Skip to content

[Console] Document SymfonyStyle additions #15975

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

Merged
merged 1 commit into from
Oct 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions console/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ Content Methods
['foo4' => 'bar4']
);

:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::createTable`
Creates an instance of :class:`Symfony\\Component\\Console\\Helper\\Table`
styled according to the Symfony Style Guide.

.. versionadded:: 5.4

The ``createTable()`` method was introduced in Symfony 5.4.

:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::newLine`
It displays a blank line in the command output. Although it may seem useful,
most of the times you won't need it at all. The reason is that every helper
Expand Down Expand Up @@ -243,6 +251,24 @@ Progress Bar Methods

$io->progressFinish();

:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::progressIterate`
If your progress bar loops over an iterable collection, use the
``progressIterate()`` helper::

$iterable = [1, 2];

foreach ($io->progressIterate($iterable) as $value) {
// ... do some work
}

.. versionadded:: 5.4

The ``progressIterate`` method was introduced in Symfony 5.4.

:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::createProgressBar`
Creates an instance of :class:`Symfony\\Component\\Console\\Helper\\ProgressBar`
styled according to the Symfony Style Guide.

User Input Methods
~~~~~~~~~~~~~~~~~~

Expand Down