Support Yaml::PARSE_CUSTOM_TAGS in \Drupal\Component\Serialization\YamlSymfony::decode

Created on 23 January 2020, almost 5 years ago
Updated 29 May 2024, 6 months ago

Problem/Motivation

Symfony 3.4 provides a shortcut to inject all services tagged with a specific tag, which is a common need in some applications, so you don't have to write a compiler pass just for that.

However, when you use a tagged argument the YAML decoder needs to support 'custom tags'.
Which at the moment is not supported in Drupal.

There is more that can be done with custom tags since Symfony 3.3. to mention a few, here are some of the custom tags that are already supported by Symfony YAML component.

!!binary for storing binary data
!php/const: for referring to PHP constants.
It already supports also defining your own custom YAML tags (Custom tags are arbitrary strings that start with the ! character, such as the !my_tag value).
The above can only be possible if the Yaml::PARSE_CUSTOM_TAGS flag is supported in Drupal.

Proposed resolution

Update Drupal\Component\Serialization\YamlSymfony::decode and pass in the flag 'SymfonyYaml::PARSE_CUSTOM_TAGS'

Remaining tasks

User interface changes

None

API changes

No change.

Data model changes

None

πŸ“Œ Task
Status

Fixed

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡³πŸ‡±Netherlands bonrita

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024