-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] Allow dumping empty array as YAML sequence #21471
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ class Yaml | |
const DUMP_OBJECT_AS_MAP = 64; | ||
const DUMP_MULTI_LINE_LITERAL_BLOCK = 128; | ||
const PARSE_CONSTANT = 256; | ||
const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 512; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alpha order? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want me to sort all constants alphabetically? I don't see this convention being used elsewhere in Symfony. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would keep it this way. Otherwise, it's becoming hard to add new flags as you need to be extra careful to not reuse one of the existing flag values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can't we change the values of the consts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like the way it is now, the more recent addition are last with a higher number. I don't see why we should order them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for being late here, but I had no time during the weekend to do the final review. This value must be adjusted as 512 is already used by the new tags support feature (see #21678). |
||
|
||
/** | ||
* Parses YAML into a PHP value. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not expect an empty sequence as the result with this input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Fixed.