File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,21 @@ official YAML specification but are useful in Symfony applications:
338338 data :
339339 my_object : !php/object 'O:8:"stdClass":1:{s:3:"bar";i:2;}'
340340
341+ * ``!php/enum `` allows to use a PHP enum case. This tag takes the fully-qualified
342+ class name of the enum case as its argument:
343+
344+ .. code-block :: yaml
345+
346+ data :
347+ # You can use the typed enum case...
348+ operator_type : !php/enum App\Operator\Enum\Type::Or
349+ # ... or you can also use "->value" to directly use the value of a BackedEnum case
350+ operator_type : !php/enum App\Operator\Enum\Type::Or->value
351+
352+ .. versionadded :: 6.2
353+
354+ The ``!php/enum `` tag was introduced in Symfony 6.2.
355+
341356Unsupported YAML Features
342357~~~~~~~~~~~~~~~~~~~~~~~~~
343358
You can’t perform that action at this time.
0 commit comments