mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-10 22:22:29 +00:00
Development
- Better php7 support. - Added easier way to debug router. - Improvements and bugfixes. - Updated documentation.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Pecee\SimpleRouter\Route;
|
||||
|
||||
use Pecee\Http\Request;
|
||||
use Pecee\SimpleRouter\Router;
|
||||
|
||||
interface ILoadableRoute extends IRoute
|
||||
{
|
||||
@@ -18,22 +19,32 @@ interface ILoadableRoute extends IRoute
|
||||
public function findUrl($method = null, $parameters = null, $name = null): string;
|
||||
|
||||
/**
|
||||
* Loads and renders middlewares-classes
|
||||
* Loads and renders middleware-classes
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Router $router
|
||||
*/
|
||||
public function loadMiddleware(Request $request);
|
||||
public function loadMiddleware(Request $request, Router $router): void;
|
||||
|
||||
public function getUrl();
|
||||
/**
|
||||
* Get url
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl(): string;
|
||||
|
||||
public function setUrl($url);
|
||||
/**
|
||||
* Set url
|
||||
* @param string $url
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl(string $url): self;
|
||||
|
||||
/**
|
||||
* Returns the provided name for the router.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): string;
|
||||
public function getName(): ?string;
|
||||
|
||||
/**
|
||||
* Check if route has given name.
|
||||
@@ -41,7 +52,7 @@ interface ILoadableRoute extends IRoute
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function hasName($name): bool;
|
||||
public function hasName(string $name): bool;
|
||||
|
||||
/**
|
||||
* Sets the router name, which makes it easier to obtain the url or router at a later point.
|
||||
@@ -49,14 +60,14 @@ interface ILoadableRoute extends IRoute
|
||||
* @param string $name
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name): self;
|
||||
public function setName(string $name): self;
|
||||
|
||||
/**
|
||||
* Get regular expression match used for matching route (if defined).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMatch(): string;
|
||||
public function getMatch(): ?string;
|
||||
|
||||
/**
|
||||
* Add regular expression match for the entire route.
|
||||
|
||||
Reference in New Issue
Block a user