Skip to content

Commit 0252116

Browse files
committed
feature symfony#25294 [Serializer] Parse PHP constants in YAML mappings (ostrolucky)
This PR was merged into the 4.1-dev branch. Discussion ---------- [Serializer] Parse PHP constants in YAML mappings | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- b82f301 [Serializer] Parse PHP constants in YAML mappings
2 parents 5ed5dcf + b82f301 commit 0252116

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Serializer/Mapping/Loader/YamlFileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Serializer\Mapping\AttributeMetadata;
1616
use Symfony\Component\Serializer\Mapping\ClassMetadataInterface;
1717
use Symfony\Component\Yaml\Parser;
18+
use Symfony\Component\Yaml\Yaml;
1819

1920
/**
2021
* YAML File Loader.
@@ -113,7 +114,7 @@ private function getClassesFromYaml()
113114
$this->yamlParser = new Parser();
114115
}
115116

116-
$classes = $this->yamlParser->parseFile($this->file);
117+
$classes = $this->yamlParser->parseFile($this->file, Yaml::PARSE_CONSTANT);
117118

118119
if (empty($classes)) {
119120
return array();

0 commit comments

Comments
 (0)