From 2d2f03578acc35c2ef423618cc885ea676cd3861 Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Thu, 21 Oct 2021 08:58:39 -0400 Subject: [PATCH] document SymfonyStyle additions --- console/style.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/console/style.rst b/console/style.rst index c680e3703df..5dc5f24fca8 100644 --- a/console/style.rst +++ b/console/style.rst @@ -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 @@ -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 ~~~~~~~~~~~~~~~~~~