Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 39b0e19

Browse files
committed
Moves the RouteResultObserverInterface back to the Expressive namespace
This patch moves the `RouteResultObserverInterface` into the `Zend\Expressive` namespace. Since it is triggered by `Application`, it is an application-level responsibility, not the router's. Since the class names do not conflict, this can lead to an immediate deprecation of the original interface in the zend-expressive-router package. However, zend-expressive-zendviewrenderer will need updates so that it fulfills the new interface via its `UrlHelper` instance.
1 parent 2ca2f21 commit 39b0e19

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

src/Application.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,19 @@ public function any($path, $middleware, $name = null)
176176
/**
177177
* Attach a route result observer.
178178
*
179-
* @param Router\RouteResultObserverInterface $observer
179+
* @param RouteResultObserverInterface $observer
180180
*/
181-
public function attachRouteResultObserver(Router\RouteResultObserverInterface $observer)
181+
public function attachRouteResultObserver(RouteResultObserverInterface $observer)
182182
{
183183
$this->routeResultObservers[] = $observer;
184184
}
185185

186186
/**
187187
* Detach a route result observer.
188188
*
189-
* @param Router\RouteResultObserverInterface $observer
189+
* @param RouteResultObserverInterface $observer
190190
*/
191-
public function detachRouteResultObserver(Router\RouteResultObserverInterface $observer)
191+
public function detachRouteResultObserver(RouteResultObserverInterface $observer)
192192
{
193193
if (false === ($index = array_search($observer, $this->routeResultObservers, true))) {
194194
return;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* Zend Framework (http://framework.zend.com/)
4+
*
5+
* @see https://github.com/zendframework/zend-expressive for the canonical source repository
6+
* @copyright Copyright (c) 2015 Zend Technologies USA Inc. (http://www.zend.com)
7+
* @license https://github.com/zendframework/zend-expressive/blob/master/LICENSE.md New BSD License
8+
*/
9+
10+
namespace Zend\Expressive;
11+
12+
use Zend\Expressive\Router\RouteResult;
13+
14+
interface RouteResultObserverInterface
15+
{
16+
/**
17+
* Observe a route result.
18+
*
19+
* @param RouteResult $result
20+
*/
21+
public function update(RouteResult $result);
22+
}

test/RouteMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Zend\Diactoros\ServerRequest;
1717
use Zend\Expressive\Application;
1818
use Zend\Expressive\Router\RouteResult;
19-
use Zend\Expressive\Router\RouteResultObserverInterface;
19+
use Zend\Expressive\RouteResultObserverInterface;
2020
use Zend\Expressive\Router\RouterInterface;
2121

2222
class RouteMiddlewareTest extends TestCase

0 commit comments

Comments
 (0)