8000 [Yaml] Add the `Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES` flag to enforce double quotes around string values by dkarlovi · Pull Request #59880 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Yaml] Add the Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES flag to enforce double quotes around string values #59880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

dkarlovi
Copy link
Contributor
@dkarlovi dkarlovi commented Feb 28, 2025
Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #59680
License MIT

In some scenarios, quoting even safe values is encouraged by various inspectors, for example PHPStorm inspectors will mark it with a warning when used in Kubernetes ConfigMap dump.

This option allows forcing the quotes even when technically not required, see #59680 for an example.

@carsonbot

This comment was marked as resolved.

@carsonbot

This comment was marked as resolved.

@dkarlovi
Copy link
Contributor Author

Build failures unrelated.

Copy link
Member
@alexandre-daubois alexandre-daubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yaml also supports quoting keys. Maybe the constant name should reflect that only values are actually quoted, not keys?

@dkarlovi dkarlovi changed the title [Yaml] Add force dumping with quotes support by using the Yaml::DUMP_FORCE_QUOTES flag [Yaml] Add the Yaml::DUMP_FORCE_DOUBLE_QUOTES_ON_VALUES flag to enforce double quotes around string values Mar 4, 2025
@dkarlovi dkarlovi force-pushed the feat/yaml-force-quotes branch from a3950ea to 4c68909 Compare March 4, 2025 10:11
@dkarlovi
Copy link
Contributor Author
dkarlovi commented Mar 4, 2025

Fixed and squashed.

@dkarlovi dkarlovi force-pushed the feat/yaml-force-quotes branch from 4c68909 to 1c06770 Compare March 6, 2025 16:19
@fabpot
Copy link
Member
fabpot commented Mar 8, 2025

Thank you @dkarlovi.

@fabpot fabpot merged commit 3d4e0d6 into symfony:7.3 Mar 8, 2025
10 of 11 checks passed
@dkarlovi dkarlovi deleted the feat/yaml-force-quotes branch March 8, 2025 16:09
@fabpot fabpot mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Yaml] allow forcing quotes with dump() even if they're technically not required
7 participants
0