Commit 3b9abe1e authored by catch's avatar catch

Issue #2139583 by damiankloip, dawehner: Clarify error message when...

Issue #2139583 by damiankloip, dawehner: Clarify error message when services.yml definitions are missing top-level keys.
parent c972b3ee
...@@ -220,7 +220,7 @@ protected function validate($content, $filename) { ...@@ -220,7 +220,7 @@ protected function validate($content, $filename) {
} }
if ($keys = array_diff_key($content, array('parameters' => TRUE, 'services' => TRUE))) { if ($keys = array_diff_key($content, array('parameters' => TRUE, 'services' => TRUE))) {
$invalid_keys = htmlspecialchars(implode(', ', $keys), ENT_QUOTES, 'UTF-8'); $invalid_keys = htmlspecialchars(implode(', ', $keys), ENT_QUOTES, 'UTF-8');
throw new \InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s.', $filename, $invalid_keys)); throw new \InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s. Services have to be added under "services" and Parameters under "parameters".', $filename, $invalid_keys));
} }
return $content; return $content;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment