File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,23 @@ By default, digit-only array keys are dumped as integers. You can use the
450450 $dumped = Yaml::dump([200 => 'foo'], 2, 4, Yaml::DUMP_NUMERIC_KEY_AS_STRING);
451451 // '200': foo
452452
453+ Dumping Double Quotes on Values
454+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
455+
456+ By default, only unsafe values are double quoted. In some scenarios, quoting
457+ even safe values is encouraged by various inspectors. You can use the
458+ ``DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES `` flag to enforce double quotes::
459+
460+ $dumped = Yaml::dump(['foo' => 'bar']);
461+ // foo: bar
462+
463+ $dumped = Yaml::dump(['foo' => 'bar'], 2, 4, Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES);
464+ // foo: "bar"
465+
466+ .. versionadded :: 7.3
467+
468+ The ``Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES `` flag was introduced in Symfony 7.3.
469+
453470Dumping Collection of Maps
454471~~~~~~~~~~~~~~~~~~~~~~~~~~
455472
You can’t perform that action at this time.
0 commit comments