function YamlFileLoader::validateAlias
Throws
\InvalidArgumentException If one of the provided config keys is not supported, something is missing or the combination is nonsense
1 call to YamlFileLoader::validateAlias()
- YamlFileLoader::validate in vendor/
symfony/ routing/ Loader/ YamlFileLoader.php
File
-
vendor/
symfony/ routing/ Loader/ YamlFileLoader.php, line 278
Class
- YamlFileLoader
- YamlFileLoader loads Yaml routing files.
Namespace
Symfony\Component\Routing\LoaderCode
private function validateAlias(array $config, string $name, string $path) : void {
foreach ($config as $key => $value) {
if (!\in_array($key, [
'alias',
'deprecated',
], true)) {
throw new \InvalidArgumentException(\sprintf('The routing file "%s" must not specify other keys than "alias" and "deprecated" for "%s".', $path, $name));
}
if ('deprecated' === $key) {
if (!isset($value['package'])) {
throw new \InvalidArgumentException(\sprintf('The routing file "%s" must specify the attribute "package" of the "deprecated" option for "%s".', $path, $name));
}
if (!isset($value['version'])) {
throw new \InvalidArgumentException(\sprintf('The routing file "%s" must specify the attribute "version" of the "deprecated" option for "%s".', $path, $name));
}
}
}
}