Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300130

Allow parsing and writing PHP constants and enums in YAML files

$
0
0

Problem/Motivation

Since Symfony 3.2, PHP constants are allowed in YAML files, but the YAML parser needs to be executed with an explicit flag to make that happen. We are not using this flag in core.

With that set, we could use this notation inside YAML files:

foo: !php/const Drupal\my_module\Plugin\Foo\Bar\MyPlugin::MY_CLASS_CONSTANT_NAME
bar: !php/const BAR_GLOBAL_CONSTANT_NAME

More information:
https://symfony.com/blog/new-in-symfony-3-2-php-constants-in-yaml-files

Proposed resolution

Call the Symfony YAML parser with the Yaml::PARSE_CONSTANT flag.

Remaining tasks

Resolve constant resolution during module install and

User interface changes

API changes

Data model changes


Viewing all articles
Browse latest Browse all 300130

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>