mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fix: BC with symfony 2.1
Commit #5cc7cf212d break compatibility with Symfony 2.1 (or lower), because only in 2.2 added host support in routing.
This commit is contained in:
parent
1fac0e0cd3
commit
344ce0d3b7
@ -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';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user