Skip to content

Commit

Permalink
Zend\Controller\Router\Route\RouteInterface
Browse files Browse the repository at this point in the history
- s/Route\\RouteInterface/Route/
- updated code and tests to reflect the above
  • Loading branch information
weierophinney committed Jul 7, 2010
1 parent 7f7bf8b commit 5369f5e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
22 changes: 11 additions & 11 deletions library/Zend/Controller/Router/Rewrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Ruby routing based Router.
*
* @uses \Zend\Controller\Router\AbstractRouter
* @uses \Zend\Controller\Router\Route\Route
* @uses \Zend\Controller\Router\Route
* @uses Zend\Loader
* @package Zend_Controller
* @subpackage Router
Expand Down Expand Up @@ -58,7 +58,7 @@ class Rewrite extends AbstractRouter
/**
* Currently matched route
*
* @var \Zend\Controller\Router\Route\RouteInterface
* @var \Zend\Controller\Router\Route
*/
protected $_currentRoute = null;

Expand Down Expand Up @@ -110,10 +110,10 @@ public function addDefaultRoutes()
* If route contains method setRequest(), it is initialized with a request object
*
* @param string $name Name of the route
* @param \Zend\Controller\Router\Route\RouteInterface $route Instance of the route
* @param \Zend\Controller\Router\Route $route Instance of the route
* @return \Zend\Controller\Router\Rewrite
*/
public function addRoute($name, Route\RouteInterface $route)
public function addRoute($name, Route $route)
{
if (method_exists($route, 'setRequest')) {
$route->setRequest($this->getFrontController()->getRequest());
Expand Down Expand Up @@ -208,7 +208,7 @@ public function addConfig(Config\Config $config, $section = null)
* Get a route frm a config instance
*
* @param \Zend\Config\Config $info
* @return \Zend\Controller\Router\Route\RouteInterface
* @return \Zend\Controller\Router\Route
*/
protected function _getRouteFromConfig(Config\Config $info)
{
Expand All @@ -230,12 +230,12 @@ protected function _getRouteFromConfig(Config\Config $info)
* Add chain routes from a config route
*
* @param string $name
* @param \Zend\Controller\Router\Route\RouteInterface $route
* @param \Zend\Controller\Router\Route $route
* @param \Zend\Config\Config $childRoutesInfo
* @return void
*/
protected function _addChainRoutesFromConfig($name,
Route\RouteInterface $route,
Route $route,
Config\Config $childRoutesInfo)
{
foreach ($childRoutesInfo as $childRouteName => $childRouteInfo) {
Expand Down Expand Up @@ -285,7 +285,7 @@ public function removeRoute($name)
/**
* Remove all standard default routes
*
* @param \Zend\Controller\Router\Route\RouteInterface Route
* @param \Zend\Controller\Router\Route Route
* @return \Zend\Controller\Router\Rewrite
*/
public function removeDefaultRoutes()
Expand All @@ -311,7 +311,7 @@ public function hasRoute($name)
*
* @param string $name Name of the route
* @throws \Zend\Controller\Router\Exception
* @return \Zend\Controller\Router\Route\RouteInterface Route object
* @return \Zend\Controller\Router\Route Route object
*/
public function getRoute($name)
{
Expand All @@ -327,7 +327,7 @@ public function getRoute($name)
* Retrieve a currently matched route
*
* @throws \Zend\Controller\Router\Exception
* @return \Zend\Controller\Router\Route\RouteInterface Route object
* @return \Zend\Controller\Router\Route Route object
*/
public function getCurrentRoute()
{
Expand All @@ -342,7 +342,7 @@ public function getCurrentRoute()
* Retrieve a name of currently matched route
*
* @throws \Zend\Controller\Router\Exception
* @return \Zend\Controller\Router\Route\RouteInterface Route object
* @return \Zend\Controller\Router\Route Route object
*/
public function getCurrentRouteName()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
/**
* @namespace
*/
namespace Zend\Controller\Router\Route;
namespace Zend\Controller\Router;

/**
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface RouteInterface {
interface Route {
public function match($path);
public function assemble($data = array(), $reset = false, $encode = false);
public static function getInstance(\Zend\Config\Config $config);
Expand Down
6 changes: 4 additions & 2 deletions library/Zend/Controller/Router/Route/AbstractRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@
*/
namespace Zend\Controller\Router\Route;

use Zend\Controller\Router\Route;

/**
* Abstract Route
*
* Implements interface and provides convenience methods
*
* @uses \Zend\Controller\Router\Route\RouteInterface
* @uses \Zend\Controller\Router\Route
* @uses \Zend\Controller\Router\Route\Chain
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractRoute implements RouteInterface
abstract class AbstractRoute implements Route
{
/**
* Wether this route is abstract or not
Expand Down
4 changes: 2 additions & 2 deletions tests/Zend/Controller/Router/RewriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public static function getInstance(Config\Config $config) {}
public function assemble($data = array(), $reset = false, $encode = false) {}
}

class Mockup1 implements Route\RouteInterface
class Mockup1 implements Route
{
public function match($path, $partial = null)
{
Expand All @@ -777,7 +777,7 @@ public static function getInstance(Config\Config $config) {}
public function assemble($data = array(), $reset = false, $encode = false) {}
}

class Mockup2 implements Route\RouteInterface
class Mockup2 implements Route
{
protected $_request;

Expand Down
8 changes: 4 additions & 4 deletions working/PHPNamespacer-MappedClasses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1803,10 +1803,10 @@
<mappedClass>
<originalRelativeFilePath>Zend/Controller/Router/Route/Interface.php</originalRelativeFilePath>
<originalClassName>Zend_Controller_Router_Route_Interface</originalClassName>
<newRelativeFilePath>Zend/Controller/Router/Route/RouteInterface.php</newRelativeFilePath>
<newNamespace>Zend\Controller\Router\Route</newNamespace>
<newClassName>RouteInterface</newClassName>
<newFullyQualifiedName>Zend\Controller\Router\Route\RouteInterface</newFullyQualifiedName>
<newRelativeFilePath>Zend/Controller/Router/Route.php</newRelativeFilePath>
<newNamespace>Zend\Controller\Router</newNamespace>
<newClassName>Route</newClassName>
<newFullyQualifiedName>Zend\Controller\Router\Route</newFullyQualifiedName>
</mappedClass>
<mappedClass>
<originalRelativeFilePath>Zend/Controller/Router/Route/Module.php</originalRelativeFilePath>
Expand Down

0 comments on commit 5369f5e

Please sign in to comment.