From 1c093fbc00bb21752d25a1952f44b3027a1c802e Mon Sep 17 00:00:00 2001 From: Martin Melka Date: Fri, 5 May 2023 16:24:51 +0200 Subject: [PATCH] State that env var type-processors are nullable No change in behavior on the code side. This is just something that could use a clearer documentation when feeding the result of the processor to a strictly-typed PHP code. --- configuration/env_var_processors.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configuration/env_var_processors.rst b/configuration/env_var_processors.rst index 236b5c166b0..a846933474a 100644 --- a/configuration/env_var_processors.rst +++ b/configuration/env_var_processors.rst @@ -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:: @@ -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:: @@ -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:: @@ -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``: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy