[FEATURE] Added option to get/set the filterEmptyParams option on IRoute classes (as requested by: #453).

This commit is contained in:
Simon Sessingø
2021-03-22 15:06:20 +01:00
parent 87e9c19edb
commit 11fffd9a7b
2 changed files with 44 additions and 5 deletions
+15 -1
View File
@@ -22,8 +22,8 @@ interface IRoute
*
* @param Request $request
* @param Router $router
* @throws \Pecee\SimpleRouter\Exceptions\NotFoundHttpException
* @return string
* @throws \Pecee\SimpleRouter\Exceptions\NotFoundHttpException
*/
public function renderRoute(Request $request, Router $router): ?string;
@@ -206,4 +206,18 @@ interface IRoute
*/
public function setMiddlewares(array $middlewares): self;
/**
* If enabled parameters containing null-value will not be passed along to the callback.
*
* @param bool $enabled
* @return static $this
*/
public function setFilterEmptyParams(bool $enabled): self;
/**
* Status if filtering of empty params is enabled or disabled
* @return bool
*/
public function getFilterEmptyParams(): bool;
}