Permalink
Browse files

[zen-27] Renamed interfaces in Zend\Mvc

  • Loading branch information...
prolic committed Apr 21, 2012
1 parent 52120c3 commit cb731b91862773b759a50478dfdec043d84fcb8c
Showing with 208 additions and 219 deletions.
  1. +7 −7 library/Zend/Mvc/Application.php
  2. +7 −7 library/Zend/Mvc/{AppContext.php → ApplicationInterface.php}
  3. +9 −9 library/Zend/Mvc/Bootstrap.php
  4. +3 −3 library/Zend/Mvc/{Bootstrapper.php → BootstrapInterface.php}
  5. +3 −3 library/Zend/Mvc/Controller/ActionController.php
  6. +9 −9 library/Zend/Mvc/Controller/Plugin/Forward.php
  7. +3 −3 library/Zend/Mvc/Controller/Plugin/Layout.php
  8. +9 −9 library/Zend/Mvc/Controller/Plugin/Redirect.php
  9. +8 −8 library/Zend/Mvc/Controller/Plugin/Url.php
  10. +3 −3 library/Zend/Mvc/Controller/RestfulController.php
  11. +0 −6 library/Zend/Mvc/Exception.php
  12. +1 −3 library/Zend/Mvc/Exception/DomainException.php
  13. +6 −0 library/Zend/Mvc/Exception/ExceptionInterface.php
  14. +2 −4 library/Zend/Mvc/Exception/InvalidArgumentException.php
  15. +1 −4 library/Zend/Mvc/Exception/MissingLocatorException.php
  16. +1 −1 library/Zend/Mvc/{InjectApplicationEvent.php → InjectApplicationEventInterface.php}
  17. +1 −1 library/Zend/Mvc/{LocatorAware.php → LocatorAwareInterface.php}
  18. +1 −1 library/Zend/Mvc/MvcEvent.php
  19. +2 −2 library/Zend/Mvc/Router/{Exception.php → Exception/ExceptionInterface.php}
  20. +1 −3 library/Zend/Mvc/Router/Exception/InvalidArgumentException.php
  21. +1 −3 library/Zend/Mvc/Router/Exception/RuntimeException.php
  22. +6 −6 library/Zend/Mvc/Router/Http/Hostname.php
  23. +6 −6 library/Zend/Mvc/Router/Http/Literal.php
  24. +9 −9 library/Zend/Mvc/Router/Http/Part.php
  25. +5 −5 library/Zend/Mvc/Router/Http/Query.php
  26. +5 −5 library/Zend/Mvc/Router/Http/Regex.php
  27. +2 −2 library/Zend/Mvc/Router/Http/{Route.php → RouteInterface.php}
  28. +5 −5 library/Zend/Mvc/Router/Http/Scheme.php
  29. +5 −5 library/Zend/Mvc/Router/Http/Segment.php
  30. +10 −10 library/Zend/Mvc/Router/Http/TreeRouteStack.php
  31. +5 −5 library/Zend/Mvc/Router/Http/Wildcard.php
  32. +5 −5 library/Zend/Mvc/Router/PriorityList.php
  33. +2 −2 library/Zend/Mvc/Router/RouteBroker.php
  34. +2 −2 library/Zend/Mvc/Router/{Route.php → RouteInterface.php}
  35. +1 −1 library/Zend/Mvc/Router/RouteMatch.php
  36. +5 −5 library/Zend/Mvc/Router/{RouteStack.php → RouteStackInterface.php}
  37. +11 −11 library/Zend/Mvc/Router/SimpleRouteStack.php
  38. +2 −2 library/Zend/Navigation/Page/Mvc.php
  39. +9 −9 library/Zend/View/Helper/Url.php
  40. +1 −1 tests/Zend/Mvc/ApplicationTest.php
  41. +2 −2 tests/Zend/Mvc/Controller/ActionControllerTest.php
  42. +2 −2 tests/Zend/Mvc/Controller/Plugin/ForwardTest.php
  43. +2 −2 tests/Zend/Mvc/Controller/RestfulControllerTest.php
  44. +2 −2 tests/Zend/Mvc/Controller/TestAsset/UnlocatableEventfulController.php
  45. +6 −6 tests/Zend/Mvc/Router/Http/TestAsset/DummyRoute.php
  46. +3 −3 tests/Zend/Mvc/Router/Http/TestAsset/DummyRouteWithParam.php
  47. +2 −2 tests/Zend/Mvc/Router/Http/TreeRouteStackTest.php
  48. +2 −2 tests/Zend/Mvc/Router/SimpleRouteStackTest.php
  49. +6 −6 tests/Zend/Mvc/Router/TestAsset/DummyRoute.php
  50. +3 −3 tests/Zend/Mvc/Router/TestAsset/DummyRouteWithParam.php
  51. +2 −2 tests/Zend/Mvc/TestAsset/LocatorAwareController.php
  52. +1 −1 tests/Zend/Navigation/Page/MvcTest.php
  53. +1 −1 tests/Zend/View/Helper/UrlTest.php
@@ -25,7 +25,7 @@
* application, first routing, then dispatching the discovered controller. A
* response will then be returned, which may then be sent to the caller.
*/
-class Application implements AppContext
+class Application implements ApplicationInterface
{
const ERROR_CONTROLLER_CANNOT_DISPATCH = 'error-controller-cannot-dispatch';
const ERROR_CONTROLLER_NOT_FOUND = 'error-controller-not-found';
@@ -93,10 +93,10 @@ public function setResponse(Response $response)
*
* A router should return a metadata object containing a controller key.
*
- * @param Router\RouteStack $router
+ * @param Router\RouteStackInterface $router
* @return Application
*/
- public function setRouter(Router\RouteStack $router)
+ public function setRouter(Router\RouteStackInterface $router)
{
$this->router = $router;
return $this;
@@ -157,7 +157,7 @@ public function getResponse()
*/
public function getRouter()
{
- if (!$this->router instanceof Router\RouteStack) {
+ if (!$this->router instanceof Router\RouteStackInterface) {
$this->setRouter(new Router\SimpleRouteStack());
}
return $this->router;
@@ -284,7 +284,7 @@ protected function completeRequest(MvcEvent $event)
}
/**
- * Route the request
+ * RouteInterface the request
*
* @param MvcEvent $e
* @return Router\RouteMatch
@@ -348,7 +348,7 @@ public function dispatch(MvcEvent $e)
goto complete;
}
- if ($controller instanceof LocatorAware) {
+ if ($controller instanceof LocatorAwareInterface) {
$controller->setLocator($locator);
}
@@ -370,7 +370,7 @@ public function dispatch(MvcEvent $e)
$request = $e->getRequest();
$response = $this->getResponse();
- if ($controller instanceof InjectApplicationEvent) {
+ if ($controller instanceof InjectApplicationEventInterface) {
$controller->setEvent($e);
}
@@ -7,29 +7,29 @@
Zend\Stdlib\RequestDescription as Request,
Zend\Stdlib\ResponseDescription as Response;
-interface AppContext extends EventManagerAware
+interface ApplicationInterface extends EventManagerAware
{
/**
* Set a service locator/DI object
*
* @param Locator $locator
- * @return AppContext
+ * @return ApplicationInterface
*/
public function setLocator(Locator $locator);
/**
* Set request object that will be consumed
*
* @param Request $request
- * @return AppContext
+ * @return ApplicationInterface
*/
public function setRequest(Request $request);
/**
* Set response object that will be returned
*
* @param Response $request
- * @return AppContext
+ * @return ApplicationInterface
*/
public function setResponse(Response $response);
@@ -38,10 +38,10 @@ public function setResponse(Response $response);
*
* A router should return a metadata object containing a controller key.
*
- * @param Router\RouteStack $router
- * @return AppContext
+ * @param Router\RouteStackInterface $router
+ * @return ApplicationInterface
*/
- public function setRouter(Router\RouteStack $router);
+ public function setRouter(Router\RouteStackInterface $router);
/**
* Get the locator object
@@ -10,7 +10,7 @@
Zend\EventManager\StaticEventManager,
Zend\Mvc\Router\Http\TreeRouteStack as Router;
-class Bootstrap implements Bootstrapper, EventManagerAware
+class Bootstrap implements BootstrapInterface, EventManagerAware
{
/**
* @var \Zend\Config\Config
@@ -78,7 +78,7 @@ public function events()
* @param Application $application
* @return void
*/
- public function bootstrap(AppContext $application)
+ public function bootstrap(ApplicationInterface $application)
{
$this->setupLocator($application);
$this->setupRouter($application);
@@ -90,17 +90,17 @@ public function bootstrap(AppContext $application)
/**
* Sets up the locator based on the configuration provided
*
- * @param AppContext $application
+ * @param ApplicationInterface $application
* @return void
*/
- protected function setupLocator(AppContext $application)
+ protected function setupLocator(ApplicationInterface $application)
{
$di = new Di;
$di->instanceManager()->addTypePreference('Zend\Di\Locator', $di);
// Default configuration for common MVC classes
$diConfig = new DiConfiguration(array('definition' => array('class' => array(
- 'Zend\Mvc\Router\RouteStack' => array(
+ 'Zend\Mvc\Router\RouteStackInterface' => array(
'instantiator' => array(
'Zend\Mvc\Router\Http\TreeRouteStack',
'factory'
@@ -243,9 +243,9 @@ protected function setupLocator(AppContext $application)
* @param Application $application
* @return void
*/
- protected function setupRouter(AppContext $application)
+ protected function setupRouter(ApplicationInterface $application)
{
- $router = $application->getLocator()->get('Zend\Mvc\Router\RouteStack');
+ $router = $application->getLocator()->get('Zend\Mvc\Router\RouteStackInterface');
$application->setRouter($router);
}
@@ -304,10 +304,10 @@ protected function setupView($application)
* Triggers with the keys "application" and "config", the latter pointing
* to the Module Manager attached to the bootstrap.
*
- * @param AppContext $application
+ * @param ApplicationInterface $application
* @return void
*/
- protected function setupEvents(AppContext $application)
+ protected function setupEvents(ApplicationInterface $application)
{
$params = array(
'application' => $application,
@@ -27,13 +27,13 @@
* @copyright Copyright (C) 2005-2011, Zend Technologies, Inc.
* @license New BSD {@link http://framework.zend.com/license}
*/
-interface Bootstrapper
+interface BootstrapInterface
{
/**
* Bootstrap an application
*
- * @param AppContext $application
+ * @param ApplicationInterface $application
* @return void
*/
- public function bootstrap(AppContext $application);
+ public function bootstrap(ApplicationInterface $application);
}
@@ -11,8 +11,8 @@
Zend\Loader\Broker,
Zend\Loader\Pluggable,
Zend\Mvc\Exception,
- Zend\Mvc\InjectApplicationEvent,
- Zend\Mvc\LocatorAware,
+ Zend\Mvc\InjectApplicationEventInterface,
+ Zend\Mvc\LocatorAwareInterface,
Zend\Mvc\MvcEvent,
Zend\Stdlib\Dispatchable,
Zend\Stdlib\RequestDescription as Request,
@@ -22,7 +22,7 @@
/**
* Basic action controller
*/
-abstract class ActionController implements Dispatchable, EventManagerAware, InjectApplicationEvent, LocatorAware, Pluggable
+abstract class ActionController implements Dispatchable, EventManagerAware, InjectApplicationEventInterface, LocatorAwareInterface, Pluggable
{
//use \Zend\EventManager\ProvidesEvents;
@@ -3,9 +3,9 @@
namespace Zend\Mvc\Controller\Plugin;
use Zend\Di\Locator,
- Zend\Mvc\InjectApplicationEvent,
+ Zend\Mvc\InjectApplicationEventInterface,
Zend\Mvc\Exception,
- Zend\Mvc\LocatorAware,
+ Zend\Mvc\LocatorAwareInterface,
Zend\Mvc\MvcEvent,
Zend\Mvc\Router\RouteMatch,
Zend\Stdlib\Dispatchable;
@@ -21,7 +21,7 @@ class Forward extends AbstractPlugin
* @param string $name Controller name; either a class name or an alias used in the DI container or service locator
* @param null|array $params Parameters with which to seed a custom RouteMatch object for the new controller
* @return mixed
- * @throws Exception\DomainException if composed controller does not define InjectApplicationEvent
+ * @throws Exception\DomainException if composed controller does not define InjectApplicationEventInterface
* or Locator aware; or if the discovered controller is not dispatchable
*/
public function dispatch($name, array $params = null)
@@ -33,10 +33,10 @@ public function dispatch($name, array $params = null)
if (!$controller instanceof Dispatchable) {
throw new Exception\DomainException('Can only forward to Dispatchable classes; class of type ' . get_class($controller) . ' received');
}
- if ($controller instanceof InjectApplicationEvent) {
+ if ($controller instanceof InjectApplicationEventInterface) {
$controller->setEvent($event);
}
- if ($controller instanceof LocatorAware) {
+ if ($controller instanceof LocatorAwareInterface) {
$controller->setLocator($locator);
}
@@ -71,8 +71,8 @@ protected function getLocator()
$controller = $this->getController();
- if (!$controller instanceof LocatorAware) {
- throw new Exception\DomainException('Forward plugin requires controller implements LocatorAware');
+ if (!$controller instanceof LocatorAwareInterface) {
+ throw new Exception\DomainException('Forward plugin requires controller implements LocatorAwareInterface');
}
$locator = $controller->getLocator();
if (!$locator instanceof Locator) {
@@ -95,8 +95,8 @@ protected function getEvent()
}
$controller = $this->getController();
- if (!$controller instanceof InjectApplicationEvent) {
- throw new Exception\DomainException('Redirect plugin requires a controller that implements InjectApplicationEvent');
+ if (!$controller instanceof InjectApplicationEventInterface) {
+ throw new Exception\DomainException('Redirect plugin requires a controller that implements InjectApplicationEventInterface');
}
$event = $controller->getEvent();
@@ -21,7 +21,7 @@
namespace Zend\Mvc\Controller\Plugin;
-use Zend\Mvc\InjectApplicationEvent,
+use Zend\Mvc\InjectApplicationEventInterface,
Zend\Mvc\Exception,
Zend\Mvc\MvcEvent,
Zend\View\Model;
@@ -83,8 +83,8 @@ protected function getEvent()
}
$controller = $this->getController();
- if (!$controller instanceof InjectApplicationEvent) {
- throw new Exception\DomainException('Layout plugin requires a controller that implements InjectApplicationEvent');
+ if (!$controller instanceof InjectApplicationEventInterface) {
+ throw new Exception\DomainException('Layout plugin requires a controller that implements InjectApplicationEventInterface');
}
$event = $controller->getEvent();
@@ -3,10 +3,10 @@
namespace Zend\Mvc\Controller\Plugin;
use Zend\Http\Response,
- Zend\Mvc\InjectApplicationEvent,
+ Zend\Mvc\InjectApplicationEventInterface,
Zend\Mvc\Exception,
Zend\Mvc\MvcEvent,
- Zend\Mvc\Router\RouteStack;
+ Zend\Mvc\Router\RouteStackInterface;
/**
* @todo allow specifying status code as a default, or as an option to methods
@@ -20,11 +20,11 @@ class Redirect extends AbstractPlugin
/**
* Generates a URL based on a route
*
- * @param string $route Route name
+ * @param string $route RouteInterface name
* @param array $params Parameters to use in url generation, if any
- * @param array $options Route-specific options to use in url generation, if any
+ * @param array $options RouteInterface-specific options to use in url generation, if any
* @return Response
- * @throws Exception\DomainException if composed controller does not implement InjectApplicationEvent, or
+ * @throws Exception\DomainException if composed controller does not implement InjectApplicationEventInterface, or
* router cannot be found in controller event
*/
public function toRoute($route, array $params = array(), array $options = array())
@@ -56,7 +56,7 @@ public function toUrl($url)
/**
* Get the router
*
- * @return RouteStack
+ * @return RouteStackInterface
* @throws Exception\DomainException if unable to find router
*/
protected function getRouter()
@@ -67,7 +67,7 @@ protected function getRouter()
$event = $this->getEvent();
$router = $event->getRouter();
- if (!$router instanceof RouteStack) {
+ if (!$router instanceof RouteStackInterface) {
throw new Exception\DomainException('Redirect plugin requires event compose a router');
}
$this->router = $router;
@@ -108,8 +108,8 @@ protected function getEvent()
}
$controller = $this->getController();
- if (!$controller instanceof InjectApplicationEvent) {
- throw new Exception\DomainException('Redirect plugin requires a controller that implements InjectApplicationEvent');
+ if (!$controller instanceof InjectApplicationEventInterface) {
+ throw new Exception\DomainException('Redirect plugin requires a controller that implements InjectApplicationEventInterface');
}
$event = $controller->getEvent();
@@ -2,28 +2,28 @@
namespace Zend\Mvc\Controller\Plugin;
-use Zend\Mvc\InjectApplicationEvent,
+use Zend\Mvc\InjectApplicationEventInterface,
Zend\Mvc\Exception,
Zend\Mvc\MvcEvent,
- Zend\Mvc\Router\RouteStack;
+ Zend\Mvc\Router\RouteStackInterface;
class Url extends AbstractPlugin
{
/**
* Generates a URL based on a route
*
- * @param string $route Route name
+ * @param string $route RouteInterface name
* @param array $params Parameters to use in url generation, if any
- * @param array $options Route-specific options to use in url generation, if any
+ * @param array $options RouteInterface-specific options to use in url generation, if any
* @return string
- * @throws Exception\DomainException if composed controller does not implement InjectApplicationEvent, or
+ * @throws Exception\DomainException if composed controller does not implement InjectApplicationEventInterface, or
* router cannot be found in controller event
*/
public function fromRoute($route, array $params = array(), array $options = array())
{
$controller = $this->getController();
- if (!$controller instanceof InjectApplicationEvent) {
- throw new Exception\DomainException('Url plugin requires a controller that implements InjectApplicationEvent');
+ if (!$controller instanceof InjectApplicationEventInterface) {
+ throw new Exception\DomainException('Url plugin requires a controller that implements InjectApplicationEventInterface');
}
$event = $controller->getEvent();
@@ -33,7 +33,7 @@ public function fromRoute($route, array $params = array(), array $options = arra
} elseif ($event instanceof Event) {
$router = $event->getParam('router', false);
}
- if (!$router instanceof RouteStack) {
+ if (!$router instanceof RouteStackInterface) {
throw new Exception\DomainException('Url plugin requires that controller event compose a router; none found');
}
Oops, something went wrong.

0 comments on commit cb731b9

Please sign in to comment.