Development

- Removed temporary `RouterException` class.
- Added object-types to parameters in `CallbackExceptionHandler` and `SimpleRouter` classes.
- Router now renders groups even if callback is null.
- Renamed `setMiddleware` to `addMiddleware` in `Route` class and `IRoute` interface.
- `addMiddleware` now accept both object and class strings in `Route` class.
- `addExceptionHandler` now accept both object and class strings in `RouteGroup` class.
- Added unit-test for rewrite-exception message change: `testRewriteExceptionMessage` in `RouterRewriteTest`.
- Fixed typo: renamed `testSimularUrls` to `testSimilarUrls` in `RouterUrlTest`.
This commit is contained in:
Simon Sessingø
2017-07-08 11:21:18 +02:00
parent d411b31cc2
commit b07348a3df
12 changed files with 84 additions and 69 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ class RouteGroup extends Route implements IGroupRoute
*/
public function matchDomain(Request $request)
{
if (count($this->domains) === 0) {
if ($this->domains === null || count($this->domains) === 0) {
return true;
}
@@ -59,10 +59,10 @@ class RouteGroup extends Route implements IGroupRoute
/**
* Add exception handler
*
* @param IExceptionHandler $handler
* @param IExceptionHandler|string $handler
* @return static $this
*/
public function addExceptionHandler(IExceptionHandler $handler)
public function addExceptionHandler($handler)
{
$this->exceptionHandlers[] = $handler;