Skip to content

Commit eb22cc1

Browse files
Merge branch '2.8' into 3.4
* 2.8: Consistently throw exceptions on a single line fix fopen calls Update .editorconfig
2 parents 0a24543 + fed1896 commit eb22cc1

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
@@ -203,28 +203,16 @@ protected function validate($config, $name, $path)
203203
throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path));
204204
}
205205
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
206-
throw new \InvalidArgumentException(sprintf(
207-
'The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".',
208-
$path, $name, implode('", "', $extraKeys), implode('", "', self::$availableKeys)
209-
));
206+
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)));
210207
}
211208
if (isset($config['resource']) && isset($config['path'])) {
212-
throw new \InvalidArgumentException(sprintf(
213-
'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.',
214-
$path, $name
215-
));
209+
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));
216210
}
217211
if (!isset($config['resource']) && isset($config['type'])) {
218-
throw new \InvalidArgumentException(sprintf(
219-
'The "type" key for the route definition "%s" in "%s" is unsupported. It is only available for imports in combination with the "resource" key.',
220-
$name, $path
221-
));
212+
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));
222213
}
223214
if (!isset($config['resource']) && !isset($config['path'])) {
224-
throw new \InvalidArgumentException(sprintf(
225-
'You must define a "path" for the route "%s" in file "%s".',
226-
$name, $path
227-
));
215+
throw new \InvalidArgumentException(sprintf('You must define a "path" for the route "%s" in file "%s".', $name, $path));
228216
}
229217
if (isset($config['controller']) && isset($config['defaults']['_controller'])) {
230218
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)