From 8071b0b5db77888a0ebb746d2776477f1aaf520a Mon Sep 17 00:00:00 2001 From: PJ Dietz Date: Sun, 10 May 2015 11:21:55 -0400 Subject: [PATCH] Move MiddlewareInterface to the root namespace. --- src/Dispatching/DispatchStackInterface.php | 2 +- src/Dispatching/Dispatcher.php | 2 +- src/{Routing => }/MiddlewareInterface.php | 2 +- src/Routing/Hook/ContentLengthHook.php | 2 +- src/Routing/Hook/HeadHook.php | 2 +- src/Routing/MethodMap.php | 1 + src/Routing/MethodMapInterface.php | 2 ++ src/Routing/Route/RouteInterface.php | 2 +- src/Routing/RouterInterface.php | 2 ++ test/tests/unit/Routing/Dispatching/DispatcherTest.php | 2 +- test/tests/unit/Routing/MethodMapTest.php | 6 +++--- 11 files changed, 15 insertions(+), 10 deletions(-) rename src/{Routing => }/MiddlewareInterface.php (92%) diff --git a/src/Dispatching/DispatchStackInterface.php b/src/Dispatching/DispatchStackInterface.php index 936972a..af20cc6 100644 --- a/src/Dispatching/DispatchStackInterface.php +++ b/src/Dispatching/DispatchStackInterface.php @@ -4,7 +4,7 @@ namespace WellRESTed\Dispatching; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; -use WellRESTed\Routing\MiddlewareInterface; +use WellRESTed\MiddlewareInterface; interface DispatchStackInterface extends MiddlewareInterface { diff --git a/src/Dispatching/Dispatcher.php b/src/Dispatching/Dispatcher.php index b56a40d..3b8f671 100644 --- a/src/Dispatching/Dispatcher.php +++ b/src/Dispatching/Dispatcher.php @@ -4,7 +4,7 @@ namespace WellRESTed\Dispatching; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; -use WellRESTed\Routing\MiddlewareInterface; +use WellRESTed\MiddlewareInterface; class Dispatcher implements DispatcherInterface { diff --git a/src/Routing/MiddlewareInterface.php b/src/MiddlewareInterface.php similarity index 92% rename from src/Routing/MiddlewareInterface.php rename to src/MiddlewareInterface.php index ebfab84..eb54eff 100644 --- a/src/Routing/MiddlewareInterface.php +++ b/src/MiddlewareInterface.php @@ -1,6 +1,6 @@ next = function ($request, $response) { return $response; }; - $this->middleware = $this->prophesize('WellRESTed\Routing\MiddlewareInterface'); + $this->middleware = $this->prophesize('WellRESTed\MiddlewareInterface'); $this->middleware->dispatch(Argument::cetera())->willReturn(); } @@ -63,10 +63,10 @@ class MethodMapTest extends \PHPUnit_Framework_TestCase { $this->request->getMethod()->willReturn("get"); - $middlewareUpper = $this->prophesize('WellRESTed\Routing\MiddlewareInterface'); + $middlewareUpper = $this->prophesize('WellRESTed\MiddlewareInterface'); $middlewareUpper->dispatch(Argument::cetera())->willReturn(); - $middlewareLower = $this->prophesize('WellRESTed\Routing\MiddlewareInterface'); + $middlewareLower = $this->prophesize('WellRESTed\MiddlewareInterface'); $middlewareLower->dispatch(Argument::cetera())->willReturn(); $map = new MethodMap();