File tree 1 file changed +17
-0
lines changed
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
450
450
$dumped = Yaml::dump([200 => 'foo'], 2, 4, Yaml::DUMP_NUMERIC_KEY_AS_STRING);
451
451
// '200': foo
452
452
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
+
453
470
Dumping Collection of Maps
454
471
~~~~~~~~~~~~~~~~~~~~~~~~~~
455
472
You can’t perform that action at this time.
0 commit comments