Skip to content

Commit d998113

Browse files
Merge branch '3.4' into 4.1
* 3.4: [DI] configure inlined services before injecting them when dumping the container Consistently throw exceptions on a single line fix fopen calls Update .editorconfig
2 parents dbb73c1 + eb22cc1 commit d998113

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

Loader/YamlFileLoader.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -244,28 +244,16 @@ protected function validate($config, $name, $path)
244244
throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path));
245245
}
246246
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
247-
throw new \InvalidArgumentException(sprintf(
248-
'The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".',
249-
$path, $name, implode('", "', $extraKeys), implode('", "', self::$availableKeys)
250-
));
247+
throw new \InvalidArgumentException(sprintf('The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".', $path, $name, implode('", "', $extraKeys), implode('", "', self::$availableKeys)));
251248
}
252249
if (isset($config['resource']) && isset($config['path'])) {
253-
throw new \InvalidArgumentException(sprintf(
254-
'The routing file "%s" must not specify both the "resource" key and the "path" key for "%s". Choose between an import and a route definition.',
255-
$path, $name
256-
));
250+
throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "resource" key and the "path" key for "%s". Choose between an import and a route definition.', $path, $name));
257251
}
258252
if (!isset($config['resource']) && isset($config['type'])) {
259-
throw new \InvalidArgumentException(sprintf(
260-
'The "type" key for the route definition "%s" in "%s" is unsupported. It is only available for imports in combination with the "resource" key.',
261-
$name, $path
262-
));
253+
throw new \InvalidArgumentException(sprintf('The "type" key for the route definition "%s" in "%s" is unsupported. It is only available for imports in combination with the "resource" key.', $name, $path));
263254
}
264255
if (!isset($config['resource']) && !isset($config['path'])) {
265-
throw new \InvalidArgumentException(sprintf(
266-
'You must define a "path" for the route "%s" in file "%s".',
267-
$name, $path
268-
));
256+
throw new \InvalidArgumentException(sprintf('You must define a "path" for the route "%s" in file "%s".', $name, $path));
269257
}
270258
if (isset($config['controller']) && isset($config['defaults']['_controller'])) {
271259
throw new \InvalidArgumentException(sprintf('The routing file "%s" must not specify both the "controller" key and the defaults key "_controller" for "%s".', $path, $name));

0 commit comments

Comments
 (0)