Returns methods allowed for a route
Route $route The route:
array The methods
private function getRouteMethods(Route $route) {
$methods = array();
if ($req = $route
->getRequirement('_method')) {
$methods = explode('|', strtoupper($req));
// GET and HEAD are equivalent
if (in_array('GET', $methods) && !in_array('HEAD', $methods)) {
$methods[] = 'HEAD';
}
}
return $methods;
}