@@ -189,6 +189,9 @@ reusable configuration value. By convention, parameters are defined under the
189189 app.some_constant : !php/const GLOBAL_CONSTANT
190190 app.another_constant : !php/const App\Entity\BlogPost::MAX_ITEMS
191191
192+ # Enum case as parameter values
193+ app.some_enum : !php/enum App\Enum\PostState::Published
194+
192195 # ...
193196
194197 .. code-block :: xml
@@ -226,6 +229,9 @@ reusable configuration value. By convention, parameters are defined under the
226229 <!-- PHP constants as parameter values -->
227230 <parameter key =" app.some_constant" type =" constant" >GLOBAL_CONSTANT</parameter >
228231 <parameter key =" app.another_constant" type =" constant" >App\Entity\BlogPost::MAX_ITEMS</parameter >
232+
233+ <!-- Enum case as parameter values -->
234+ <parameter key =" app.some_enum" type =" enum" >App\Enum\PostState::Published</parameter >
229235 </parameters >
230236
231237 <!-- ... -->
@@ -237,6 +243,7 @@ reusable configuration value. By convention, parameters are defined under the
237243 namespace Symfony\Component\DependencyInjection\Loader\Configurator;
238244
239245 use App\Entity\BlogPost;
246+ use App\Enum\PostState;
240247
241248 return static function (ContainerConfigurator $containerConfigurator) {
242249 $containerConfigurator->parameters()
@@ -256,6 +263,9 @@ reusable configuration value. By convention, parameters are defined under the
256263 // PHP constants as parameter values
257264 ->set('app.some_constant', GLOBAL_CONSTANT)
258265 ->set('app.another_constant', BlogPost::MAX_ITEMS);
266+
267+ // Enum case as parameter values
268+ ->set('app.some_enum', PostState::Published);
259269 };
260270
261271 // ...
@@ -272,6 +282,10 @@ reusable configuration value. By convention, parameters are defined under the
272282 something@example.com
273283 </parameter >
274284
285+ .. versionadded :: 6.2
286+
287+ Passing an enum case as a service parameter was introduced in Symfony 6.2.
288+
275289Once defined, you can reference this parameter value from any other
276290configuration file using a special syntax: wrap the parameter name in two ``% ``
277291(e.g. ``%app.admin_email% ``):
0 commit comments