Skip to content

Commit 4393cb2

Browse files
committed
deprecate implicit string casting of mapping keys
1 parent c372f9d commit 4393cb2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Loader/YamlFileLoader.php

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

2122
/**
2223
* YamlFileLoader loads Yaml routing files.
@@ -58,7 +59,7 @@ public function load($file, $type = null)
5859
}
5960

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

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
"require-dev": {
2222
"symfony/config": "~2.8|~3.0",
2323
"symfony/http-foundation": "~2.8|~3.0",
24-
"symfony/yaml": "~2.8|~3.0",
24+
"symfony/yaml": "~3.3",
2525
"symfony/expression-language": "~2.8|~3.0",
2626
"symfony/dependency-injection": "~2.8|~3.0",
2727
"doctrine/annotations": "~1.0",
2828
"doctrine/common": "~2.2",
2929
"psr/log": "~1.0"
3030
},
3131
"conflict": {
32-
"symfony/config": "<2.8"
32+
"symfony/config": "<2.8",
33+
"symfony/yaml": "<3.3"
3334
},
3435
"suggest": {
3536
"symfony/http-foundation": "For using a Symfony Request object",

0 commit comments

Comments
 (0)