protected function validate(mixed
$config, string
$name, string
$path) { if (!\
is_array($config)) { throw new \
InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.',
$name,
$path));
} if (isset($config['alias'
])) { $this->
validateAlias($config,
$name,
$path);
return;
} if ($extraKeys =
array_diff(array_keys($config), self::AVAILABLE_KEYS
)) { throw new \
InvalidArgumentException(sprintf('The routing file "%s" contains unsupported keys for "%s": "%s". Expected one of: "%s".',
$path,
$name,
implode('", "',
$extraKeys),
implode('", "', self::AVAILABLE_KEYS
)));
} if (isset($config['resource'
]) &&
isset($config['path'
])) { 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));
} if (!
isset($config['resource'
]) &&
isset($config['type'
])) { 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));
}