mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 06:48:41 +00:00
fix docblock and function parameter
This commit is contained in:
parent
93a972eb55
commit
da72383619
|
|
@ -230,7 +230,7 @@ final class Request extends RequestAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create request from super globals.
|
* Create request from superglobals.
|
||||||
*
|
*
|
||||||
* @return Request
|
* @return Request
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -80,12 +80,13 @@ final class Router
|
||||||
* @param string $route Route regex
|
* @param string $route Route regex
|
||||||
* @param mixed $destination Destination e.g. Module:function string or callback
|
* @param mixed $destination Destination e.g. Module:function string or callback
|
||||||
* @param int $verb Request verb
|
* @param int $verb Request verb
|
||||||
|
* @param bool $csrf Is CSRF token required
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function add(string $route, $destination, int $verb = RouteVerb::GET) : void
|
public function add(string $route, $destination, int $verb = RouteVerb::GET, bool $csrf = false) : void
|
||||||
{
|
{
|
||||||
if (!isset($this->routes[$route])) {
|
if (!isset($this->routes[$route])) {
|
||||||
$this->routes[$route] = [];
|
$this->routes[$route] = [];
|
||||||
|
|
@ -94,6 +95,7 @@ final class Router
|
||||||
$this->routes[$route][] = [
|
$this->routes[$route][] = [
|
||||||
'dest' => $destination,
|
'dest' => $destination,
|
||||||
'verb' => $verb,
|
'verb' => $verb,
|
||||||
|
'csrf' => $csrf,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user