Skip to content

Commit fed1896

Browse files
Consistently throw exceptions on a single line
1 parent b3a1145 commit fed1896

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
@@ -209,28 +209,16 @@ protected function validate($config, $name, $path)
209209
throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path));
210210
}
211211
if ($extraKeys = array_diff(array_keys($config), self::$availableKeys)) {
212-
throw new \InvalidArgumentException(sprintf(
213-
'The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".',
214-
$path, $name, implode('", "', $extraKeys), implode('", "', self::$availableKeys)
215-
));
212+
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)));
216213
}
217214
if (isset($config['resource']) && isset($config['path'])) {
218-
throw new \InvalidArgumentException(sprintf(
219-
'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.',
220-
$path, $name
221-
));
215+
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));
222216
}
223217
if (!isset($config['resource']) && isset($config['type'])) {
224-
throw new \InvalidArgumentException(sprintf(
225-
'The "type" key for the route definition "%s" in "%s" is unsupported. It is only available for imports in combination with the "resource" key.',
226-
$name, $path
227-
));
218+
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));
228219
}
229220
if (!isset($config['resource']) && !isset($config['path'])) {
230-
throw new \InvalidArgumentException(sprintf(
231-
'You must define a "path" for the route "%s" in file "%s".',
232-
$name, $path
233-
));
221+
throw new \InvalidArgumentException(sprintf('You must define a "path" for the route "%s" in file "%s".', $name, $path));
234222
}
235223
}
236224
}

0 commit comments

Comments
 (0)