mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-01 15:29:58 +00:00
b07348a3df
- 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`.
70 lines
1.3 KiB
PHP
70 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Pecee\SimpleRouter\Route;
|
|
|
|
use Pecee\Handlers\IExceptionHandler;
|
|
use Pecee\Http\Request;
|
|
|
|
interface IGroupRoute extends IRoute
|
|
{
|
|
/**
|
|
* Method called to check if a domain matches
|
|
*
|
|
* @param Request $request
|
|
* @return bool
|
|
*/
|
|
public function matchDomain(Request $request);
|
|
|
|
/**
|
|
* Add exception handler
|
|
*
|
|
* @param IExceptionHandler|string $handler
|
|
* @return static $this;
|
|
*/
|
|
public function addExceptionHandler($handler);
|
|
|
|
/**
|
|
* Set exception-handlers for group
|
|
*
|
|
* @param array $handlers
|
|
* @return static $this
|
|
*/
|
|
public function setExceptionHandlers(array $handlers);
|
|
|
|
/**
|
|
* Get exception-handlers for group
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getExceptionHandlers();
|
|
|
|
/**
|
|
* Get domains for domain.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getDomains();
|
|
|
|
/**
|
|
* Set allowed domains for group.
|
|
*
|
|
* @param array $domains
|
|
* @return $this
|
|
*/
|
|
public function setDomains(array $domains);
|
|
|
|
/**
|
|
* Set prefix that child-routes will inherit.
|
|
*
|
|
* @param string $prefix
|
|
* @return string
|
|
*/
|
|
public function setPrefix($prefix);
|
|
|
|
/**
|
|
* Get prefix.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getPrefix();
|
|
} |