]> source.dussan.org Git - nextcloud-server.git/commitdiff
Replace `_method` requirement by {g,s}etMethods()
authorDavid Prévot <taffit@debian.org>
Sun, 19 Apr 2015 16:00:58 +0000 (12:00 -0400)
committerDavid Prévot <taffit@debian.org>
Sun, 19 Apr 2015 16:08:29 +0000 (12:08 -0400)
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

lib/private/route/route.php

index cb864d3d73d8e96fcd11f947ae76621633533461..b33360f11ec872747a787e5c2fc2e4bdf93125a9 100644 (file)
@@ -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'];