Skip to content

Commit 6607050

Browse files
committed
Tweaks and additions
1 parent 6c3b8c5 commit 6607050

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

components/console/usage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ You can suppress output with:
6565

6666
.. code-block:: terminal
6767
68+
# suppresses all output, including errors
69+
$ php application.php list --silent
70+
6871
# suppresses all output except errors
6972
$ php application.php list --quiet
7073
$ php application.php list -q
7174
72-
# suppresses all output, including errors
73-
$ php application.php list --silent
74-
7575
.. versionadded:: 7.2
7676

7777
The ``--silent`` option was introduced in Symfony 7.2.

console/input.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ The Console component adds some predefined options to all commands:
446446

447447
* ``--verbose``: sets the verbosity level (e.g. ``1`` the default, ``2`` and
448448
``3``, or you can use respective shortcuts ``-v``, ``-vv`` and ``-vvv``)
449-
* ``--quiet``: disables output and interaction (errors are still displayed)
450449
* ``--silent``: disables all output and interaction, including errors
450+
* ``--quiet``: disables output and interaction, but errors are still displayed
451451
* ``--no-interaction``: disables interaction
452452
* ``--version``: outputs the version number of the console application
453453
* ``--help``: displays the command help

console/verbosity.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ messages, but you can control their verbosity with the ``-q`` and ``-v`` options
77

88
.. code-block:: terminal
99
10-
# do not output any message (not even the command result messages) but display errors
11-
$ php bin/console some-command -q
12-
$ php bin/console some-command --quiet
13-
1410
# suppress all output, including errors
1511
$ php bin/console some-command --silent
1612
13+
# suppress all output (even the command result messages) but display errors
14+
$ php bin/console some-command -q
15+
$ php bin/console some-command --quiet
16+
1717
# normal behavior, no option required (display only the useful messages)
1818
$ php bin/console some-command
1919
@@ -26,6 +26,10 @@ messages, but you can control their verbosity with the ``-q`` and ``-v`` options
2626
# display all messages (useful to debug errors)
2727
$ php bin/console some-command -vvv
2828
29+
.. versionadded:: 7.2
30+
31+
The ``--silent`` option was introduced in Symfony 7.2.
32+
2933
The verbosity level can also be controlled globally for all commands with the
3034
``SHELL_VERBOSITY`` environment variable (the ``-q`` and ``-v`` options still
3135
have more precedence over the value of ``SHELL_VERBOSITY``):
@@ -41,10 +45,6 @@ Console option ``SHELL_VERBOSITY`` value Equivalent PHP constant
4145
``-vvv`` ``3`` ``OutputInterface::VERBOSITY_DEBUG``
4246
===================== ========================= ===========================================
4347

44-
.. versionadded:: 7.2
45-
46-
The ``--silent`` option was introduced in Symfony 7.2.
47-
4848
It is possible to print a message in a command for only a specific verbosity
4949
level. For example::
5050

@@ -66,7 +66,7 @@ level. For example::
6666
'Password: '.$input->getArgument('password'),
6767
]);
6868

69-
// available methods: ->isQuiet(), ->isVerbose(), ->isVeryVerbose(), ->isDebug()
69+
// available methods: ->isSilent(), ->isQuiet(), ->isVerbose(), ->isVeryVerbose(), ->isDebug()
7070
if ($output->isVerbose()) {
7171
$output->writeln('User class: '.get_class($user));
7272
}
@@ -81,10 +81,19 @@ level. For example::
8181
}
8282
}
8383

84-
When the quiet level is used, all output is suppressed as the default
84+
.. versionadded:: 7.2
85+
86+
The ``isSilent()`` method was introduced in Symfony 7.2.
87+
88+
When the silent or quiet level are used, all output is suppressed as the default
8589
:method:`Symfony\\Component\\Console\\Output\\Output::write` method returns
8690
without actually printing.
8791

92+
.. tip::
93+
94+
When using the ``silent`` verbosity, errors won't be displayed in the console
95+
but they will still be logged through the :doc:`Symfony logger </logger>` integration.
96+
8897
.. tip::
8998

9099
The MonologBridge provides a :class:`Symfony\\Bridge\\Monolog\\Handler\\ConsoleHandler`

0 commit comments

Comments
 (0)