Skip to content

Commit 987e874

Browse files
committed
deprecate implicit string casting of mapping keys
1 parent f7b2181 commit 987e874

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
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Translation\Exception\LogicException;
1616
use Symfony\Component\Yaml\Parser as YamlParser;
1717
use Symfony\Component\Yaml\Exception\ParseException;
18+
use Symfony\Component\Yaml\Yaml;
1819

1920
/**
2021
* YamlFileLoader loads translations from Yaml files.
@@ -39,7 +40,7 @@ protected function loadResource($resource)
3940
}
4041

4142
try {
42-
$messages = $this->yamlParser->parse(file_get_contents($resource));
43+
$messages = $this->yamlParser->parse(file_get_contents($resource), Yaml::PARSE_KEYS_AS_STRINGS);
4344
} catch (ParseException $e) {
4445
throw new InvalidResourceException(sprintf('Error parsing YAML, invalid file "%s"', $resource), 0, $e);
4546
}

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222
"require-dev": {
2323
"symfony/config": "~2.8|~3.0",
2424
"symfony/intl": "^2.8.18|^3.2.5",
25-
"symfony/yaml": "~2.8|~3.0",
25+
"symfony/yaml": "~3.3",
2626
"psr/log": "~1.0"
2727
},
2828
"conflict": {
29-
"symfony/config": "<2.8"
29+
"symfony/config": "<2.8",
30+
"symfony/yaml": "<3.3"
3031
},
3132
"suggest": {
3233
"symfony/config": "",

0 commit comments

Comments
 (0)