8000 Add Yaml::PARSE_EXCEPTION_ON_DUPLICATE to throw exceptions on duplicates by alexpott · Pull Request #19529 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Add Yaml::PARSE_EXCEPTION_ON_DUPLICATE to throw exceptions on duplicates #19529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Prev Previous commit
Next Next commit
Unnecessary logic
  • Loading branch information
alexpott committed Aug 8, 2016
commit d88671382fdae4247b3fc154b973e636f4964558
6 changes: 3 additions & 3 deletions src/Symfony/Component/Yaml/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function parse($value, $flags = 0)
// But overwriting is allowed when a merge node is used in current block.
if ($allowOverwrite || !isset($data[$key])) {
$data[$key] = null;
} elseif (!$allowOverwrite) {
} else {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicates in YAML is deprecated since version 3.3 and will cause an exception in 4.0.', $key), E_USER_DEPRECATED);
}
} else {
Expand All @@ -250,7 +250,7 @@ public function parse($value, $flags = 0)
// But overwriting is allowed when a merge node is used in current block.
if ($allowOverwrite || !isset($data[$key])) {
$data[$key] = $value;
} elseif (!$allowOverwrite) {
} else {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicates in YAML is deprecated since version 3.3 and will cause an exception in 4.0.', $key), E_USER_DEPRECATED);
}
}
Expand All @@ -260,7 +260,7 @@ public function parse($value, $flags = 0)
// But overwriting is allowed when a merge node is used in current block.
if ($allowOverwrite || !isset($data[$key])) {
$data[$key] = $value;
} elseif (!$allowOverwrite) {
} else {
@trigger_error(sprintf('Duplicate key "%s" detected whilst parsing YAML. Silent handling of duplicates in YAML is deprecated since version 3.3 and will cause an exception in 4.0.', $key), E_USER_DEPRECATED);
}
}
Expand Down
0