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