Skip to content

Commit f02c2ab

Browse files
committed
minor #20331 [Console] Update FinishedIndicator documentation for Progress indicator (LauLaman)
This PR was merged into the 7.2 branch. Discussion ---------- [Console] Update FinishedIndicator documentation for Progress indicator Hi! This is a correction to PR #20300 Which makes a wrong statement about the finished indicator. This MR seeks to resolve this and make the documentation more clear closes #20296 Commits ------- 93ca378 Update progressindicator.rst
2 parents 075caa1 + 93ca378 commit f02c2ab

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

components/console/helpers/progressindicator.rst

+14-10
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,21 @@ level of verbosity of the ``OutputInterface`` instance:
4444
| Processing...
4545
/ Processing...
4646
- Processing...
47+
✔ Finished
4748
4849
# OutputInterface::VERBOSITY_VERBOSE (-v)
4950
\ Processing... (1 sec)
5051
| Processing... (1 sec)
5152
/ Processing... (1 sec)
5253
- Processing... (1 sec)
54+
✔ Finished (1 sec)
5355
5456
# OutputInterface::VERBOSITY_VERY_VERBOSE (-vv) and OutputInterface::VERBOSITY_DEBUG (-vvv)
5557
\ Processing... (1 sec, 6.0 MiB)
5658
| Processing... (1 sec, 6.0 MiB)
5759
/ Processing... (1 sec, 6.0 MiB)
5860
- Processing... (1 sec, 6.0 MiB)
61+
✔ Finished (1 sec, 6.0 MiB)
5962
6063
.. tip::
6164

@@ -94,22 +97,23 @@ The progress indicator will now look like this:
9497
⠛ Processing...
9598
⠹ Processing...
9699
⢸ Processing...
100+
✔ Finished
97101
98-
Once the progress indicator is finished, it keeps the latest indicator value by
99-
default. You can replace it with your own::
102+
Once the progress indicator is finished, it uses the finishedIndicator value (which defaults to ✔). You can replace it with your own::
100103

101-
$progressIndicator->finish('Finished', '✅');
102-
103-
Then the progress indicator will render like this:
104-
105-
.. code-block:: text
104+
$progressIndicator = new ProgressIndicator($output, 'verbose', 100, null, '🎉');
105+
106+
try {
107+
/* do something */
108+
$progressIndicator->finish('Finished');
109+
} catch (\Exception) {
110+
$progressIndicator->finish('Failed', '🚨');
111+
}
106112

107-
⠏ Processing...
108-
⠛ Processing...
109-
✅ Finished
110113

111114
.. versionadded:: 7.2
112115

116+
The ``finishedIndicator`` parameter for the constructor was introduced in Symfony 7.2.
113117
The ``finishedIndicator`` parameter for method ``finish()`` was introduced in Symfony 7.2.
114118

115119
Customize Placeholders

0 commit comments

Comments
 (0)