Parses a route and adds it to the RouteCollection.
RouteCollection $collection A RouteCollection instance:
string $name Route name:
array $config Route definition:
string $path Full path of the YAML file being processed:
protected function parseRoute(RouteCollection $collection, $name, array $config, $path) {
$defaults = isset($config['defaults']) ? $config['defaults'] : array();
$requirements = isset($config['requirements']) ? $config['requirements'] : array();
$options = isset($config['options']) ? $config['options'] : array();
$host = isset($config['host']) ? $config['host'] : '';
$schemes = isset($config['schemes']) ? $config['schemes'] : array();
$methods = isset($config['methods']) ? $config['methods'] : array();
$route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods);
$collection
->add($name, $route);
}