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

Commit

Permalink
Merge branch 'hotfix/add-route-clarification' into develop
Browse files Browse the repository at this point in the history
Forward port #202
  • Loading branch information
weierophinney committed Dec 1, 2015
2 parents 34b3dda + 546f2bc commit 1a735bb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Third release candidate.
where received configuration is unusable, instead of silently ignoring it.
This is a small backwards compatibility break, but is done to eliminate
difficult to identify issues due to bad configuration.
- [#202](https://github.com/zendframework/zend-expressive/pull/202) clarifies
that `RouterInterface` implements **MUST** throw a `RuntimeException` if
`addRoute()` is called after either `match()` or `generateUri()` have been
called.

## 1.0.0rc2 - 2015-10-20

Expand Down
7 changes: 7 additions & 0 deletions doc/book/router/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The interface is defined as follows:
namespace Zend\Expressive\Router;

use Psr\Http\Message\ServerRequestInterface as Request;
use RuntimeException;
use Zend\Expressive\Exception;

interface RouterInterface
Expand All @@ -26,7 +27,13 @@ interface RouterInterface
* modify route instances before matching (e.g., to provide route options,
* inject a name, etc.).
*
* The method MUST raise a RuntimeException if called after either `match()`
* or `generateUri()` have already been called, to ensure integrity of the
* router between invocations of either of those methods.
*
* @param Route $route
* @throws RuntimeException when called after match() or generateUri() have
* been called.
*/
public function addRoute(Route $route);

Expand Down
7 changes: 7 additions & 0 deletions src/Router/RouterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Zend\Expressive\Router;

use Psr\Http\Message\ServerRequestInterface as Request;
use RuntimeException;
use Zend\Expressive\Exception;

/**
Expand All @@ -27,7 +28,13 @@ interface RouterInterface
* modify route instances before matching (e.g., to provide route options,
* inject a name, etc.).
*
* The method MUST raise a RuntimeException if called after either `match()`
* or `generateUri()` have already been called, to ensure integrity of the
* router between invocations of either of those methods.
*
* @param Route $route
* @throws RuntimeException when called after match() or generateUri() have
* been called.
*/
public function addRoute(Route $route);

Expand Down

0 comments on commit 1a735bb

Please sign in to comment.