10000 minor #11311 Adds deprecation for non-string env values. (dbrumann, j… · symfony/symfony-docs@711a1bf · GitHub
[go: up one dir, main page]

Skip to content

Commit 711a1bf

Browse files
committed
minor #11311 Adds deprecation for non-string env values. (dbrumann, javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Adds deprecation for non-string env values. Fixes #11279 Commits ------- 77f390b Made the deprecation notice more concise b733aea Adds deprecation for non-string env values.
2 parents 8e7e803 + 77f390b commit 711a1bf

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

configuration/environment_variables.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ whenever the corresponding environment variable is *not* found:
7777
7878
# config/services.yaml
7979
parameters:
80-
env(DATABASE_HOST): localhost
80+
env(DATABASE_HOST): 'localhost'
8181
8282
.. code-block:: xml
8383
@@ -97,6 +97,12 @@ whenever the corresponding environment variable is *not* found:
9797
// config/services.php
9898
$container->setParameter('env(DATABASE_HOST)', 'localhost');
9999
100+
.. deprecated:: 4.3
101+
102+
Passing non-string values as default values for environment variables is
103+
deprecated since Symfony 4.3. Use :ref:`environment variable processors <env-var-processors>`
104+
if you need to transform those string default values into other data types.
105+
100106
.. _configuration-env-var-in-prod:
101107

102108
Configuring Environment Variables in Production
@@ -132,6 +138,8 @@ the following:
132138
:doc:`Symfony profiler </profiler>`. In practice this shouldn't be a
133139
problem because the web profiler must **never** be enabled in production.
134140

141+
.. _env-var-processors:
142+
135143
Environment Variable Processors
136144
-------------------------------
137145

0 commit comments

Comments
 (0)
0