Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6040e5f

Browse files
committed
[Routing] Parse PHP constants in YAML routing files
1 parent a603ba0 commit 6040e5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Routing/Loader/YamlFileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Config\Resource\FileResource;
1717
use Symfony\Component\Yaml\Exception\ParseException;
1818
use Symfony\Component\Yaml\Parser as YamlParser;
19+
use Symfony\Component\Yaml\Yaml;
1920
use Symfony\Component\Config\Loader\FileLoader;
2021

2122
/**
@@ -58,7 +59,7 @@ public function load($file, $type = null)
5859
}
5960

6061
try {
61-
$parsedConfig = $this->yamlParser->parseFile($path);
62+
$parsedConfig = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT);
6263
} catch (ParseException $e) {
6364
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
6465
}

0 commit comments

Comments
 (0)