Skip to content

State that env var type-processors are nullable #18283

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

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 7 additions & 7 deletions configuration/env_var_processors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Built-In Environment Variable Processors
Symfony provides the following env var processors:

``env(string:FOO)``
Casts ``FOO`` to a string:
Casts ``FOO`` to a string or null:

.. configuration-block::

Expand Down Expand Up @@ -104,8 +104,8 @@ Symfony provides the following env var processors:
};

``env(bool:FOO)``
Casts ``FOO`` to a bool (``true`` values are ``'true'``, ``'on'``, ``'yes'``
and all numbers except ``0`` and ``0.0``; everything else is ``false``):
Casts ``FOO`` to a bool or null (``true`` values are ``'true'``, ``'on'``, ``'yes'``
and all numbers except ``0`` and ``0.0``; everything else is ``false``; except for ``null``, which stays ``null``):

.. configuration-block::

Expand Down Expand Up @@ -150,8 +150,8 @@ Symfony provides the following env var processors:
};

``env(not:FOO)``
Casts ``FOO`` to a bool (just as ``env(bool:...)`` does) except it returns the inverted value
(falsy values are returned as ``true``, truthy values are returned as ``false``):
Casts ``FOO`` to a bool or null (just as ``env(bool:...)`` does) except it returns the inverted value
(falsy values are returned as ``true``, truthy values are returned as ``false``, ``null`` stays ``null``):

.. configuration-block::

Expand Down Expand Up @@ -185,10 +185,10 @@ Symfony provides the following env var processors:
$container->setParameter('safe_for_production', '%env(not:APP_DEBUG)%');

``env(int:FOO)``
Casts ``FOO`` to an int.
Casts ``FOO`` to an int or null.

``env(float:FOO)``
Casts ``FOO`` to a float.
Casts ``FOO`` to a float or null.

``env(const:FOO)``
Finds the const value named in ``FOO``:
Expand Down