Skip to content

[Console] Add SignalMap to map signal value to its name #18438

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
Jun 21, 2023
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
12 changes: 12 additions & 0 deletions components/console/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,18 @@ Symfony doesn't handle any signal received by the command (not even ``SIGKILL``,
``SIGTERM``, etc). This behavior is intended, as it gives you the flexibility to
handle all signals e.g. to do some tasks before terminating the command.

.. tip::

If you need to fetch the signal name from its integer value (e.g. for logging),
you can use the
:method:`Symfony\\Component\\Console\\SignalRegistry\\SignalMap::getSignalName`
method.

.. versionadded:: 6.4

The :class:`Symfony\\Component\\Console\\SignalRegistry\\SignalMap` class was
introduced in Symfony 6.4.

.. deprecated:: 6.3

In Symfony versions previous to 6.3, all signals (except ``SIGUSR1`` and
Expand Down