OSDN Git Service

Remove method map() of PHPRouter\Router
authorJefersson Nathan <admin@phpse.net>
Wed, 12 Feb 2014 18:35:02 +0000 (16:35 -0200)
committerJefersson Nathan <admin@phpse.net>
Wed, 12 Feb 2014 18:38:41 +0000 (16:38 -0200)
src/PHPRouter/Router.php

index 1461f5c..72dd77a 100755 (executable)
@@ -1,7 +1,6 @@
 <?php
 namespace PHPRouter;
 
-use ReflectionObject;
 use Exception;
 /**
  * Routing class to match request URL's against given routes and map them to a controller action.
@@ -34,7 +33,7 @@ class Router
 
     /**
      * Set the base _url - gets prepended to all route _url's.
-     * @param string $base_url 
+     * @param $basePath
      */
     public function setBasePath($basePath)
     {
@@ -42,43 +41,6 @@ class Router
     }
 
     /**
-    * Route factory method
-    *
-    * Maps the given URL to the given target.
-    * @param string $routeUrl string
-    * @param mixed $target The target of this route. Can be anything. You'll have to provide your own method to turn *      this into a filename, controller / action pair, etc..
-    * @param array $args Array of optional arguments.
-    */
-    public function map($routeUrl, $target = '', array $args = array())
-    {
-        $route = new Route($this->_basePath . $routeUrl, array(
-           '_controller' => 'asd'
-
-        ));
-
-
-        $route->setTarget($target);
-
-        if(isset($args['methods'])) {
-            $methods = explode(',', $args['methods']);
-            $route->setMethods($methods);
-        }
-
-        if(isset($args['filters'])) {
-            $route->setFilters($args['filters']);
-        }
-
-        if(isset($args['name'])) {
-            $route->setName($args['name']);
-            if (!isset($this->_namedRoutes[$route->getName()])) {
-                $this->_namedRoutes[$route->getName()] = $route;
-            }
-        }
-
-        $this->_routes->add($routeUrl ,$route);
-    }
-
-    /**
     * Matches the current request against mapped routes
     */
     public function matchCurrentRequest()