Merge pull request #176 from iniweb/master

Fix: BC with symfony 2.1
This commit is contained in:
Jordi Boggiano 2013-04-12 00:49:55 -07:00
commit f5a409fd43

View File

@ -307,7 +307,13 @@ class ApiDoc
public function setRoute(Route $route)
{
$this->route = $route;
$this->host = $route->getHost() ?: null;
if (method_exists($route, 'getHost')) {
$this->host = $route->getHost() ? : null;
} else {
$this->host = null;
}
$this->uri = $route->getPattern();
$this->method = $route->getRequirement('_method') ?: 'ANY';
}