diff options
author | David Prévot <taffit@debian.org> | 2015-04-19 12:00:58 -0400 |
---|---|---|
committer | David Prévot <taffit@debian.org> | 2015-04-19 12:08:29 -0400 |
commit | 7f2f92847be98bbf3a0a5ca8567fab001bb131c1 (patch) | |
tree | c1839401c289cce497eb01a0941a537974d1ac94 | |
parent | d877c1f1e12d1ac03b99e172f15804b503400139 (diff) | |
download | nextcloud-server-7f2f92847be98bbf3a0a5ca8567fab001bb131c1.tar.gz nextcloud-server-7f2f92847be98bbf3a0a5ca8567fab001bb131c1.zip |
Replace `_method` requirement by {g,s}etMethods()
Make the call compatible with future Symfony version, and avoid
E_USER_DEPRECATED as thrown by the current 2.7.0-beta1:
The "_method" requirement is deprecated since version 2.2 and will be
removed in 3.0. Use getMethods() instead. at
…/Symfony/Component/Routing/Route.php#554
The "_method" requirement is deprecated since version 2.2 and will be
removed in 3.0. Use the setMethods() method instead or the "methods"
option in the route definition. at
…/Symfony/Component/Routing/Route.php#662
-rw-r--r-- | lib/private/route/route.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/route/route.php b/lib/private/route/route.php index cb864d3d73d..b33360f11ec 100644 --- a/lib/private/route/route.php +++ b/lib/private/route/route.php @@ -37,7 +37,7 @@ class Route extends SymfonyRoute implements IRoute { * @return \OC\Route\Route */ public function method($method) { - $this->setRequirement('_method', strtoupper($method)); + $this->setMethods($method); return $this; } @@ -109,7 +109,7 @@ class Route extends SymfonyRoute implements IRoute { * @return \OC\Route\Route */ public function requirements($requirements) { - $method = $this->getRequirement('_method'); + $method = $this->getMethods(); $this->setRequirements($requirements); if (isset($requirements['_method'])) { $method = $requirements['_method']; |