Browse Source

Rename method to setPatterns()

Mark Story 8 years ago
parent
commit
55c2869bd3
2 changed files with 5 additions and 5 deletions
  1. 2 2
      src/Routing/Route/Route.php
  2. 3 3
      tests/TestCase/Routing/Route/RouteTest.php

+ 2 - 2
src/Routing/Route/Route.php

@@ -182,12 +182,12 @@ class Route
     }
 
     /**
-     * Set pattern requirements for routing parameters
+     * Set routing key patterns for routing parameters
      *
      * @param array $patterns The patterns to apply to routing elements
      * @return $this
      */
-    public function setRequirements(array $patterns)
+    public function setPatterns(array $patterns)
     {
         $this->options = array_merge($this->options, $patterns);
 

+ 3 - 3
tests/TestCase/Routing/Route/RouteTest.php

@@ -1555,14 +1555,14 @@ class RouteTest extends TestCase
     }
 
     /**
-     * Test setting requirements through the method
+     * Test setting patterns through the method
      *
      * @return void
      */
-    public function testSetRequirements()
+    public function testSetPatterns()
     {
         $route = new Route('/reviews/:date/:id', ['controller' => 'Reviews', 'action' => 'view']);
-        $result = $route->setRequirements([
+        $result = $route->setPatterns([
             'date' => '\d+\-\d+\-\d+',
             'id' => '[a-z]+'
         ]);