diff --git a/Message/Http/Request.php b/Message/Http/Request.php index 581f3d191..79f4649a7 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -230,7 +230,7 @@ final class Request extends RequestAbstract } /** - * Create request from super globals. + * Create request from superglobals. * * @return Request * diff --git a/Router/Router.php b/Router/Router.php index 1d1b5fa25..53f5120c9 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -80,12 +80,13 @@ final class Router * @param string $route Route regex * @param mixed $destination Destination e.g. Module:function string or callback * @param int $verb Request verb + * @param bool $csrf Is CSRF token required * * @return void * * @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])) { $this->routes[$route] = []; @@ -94,6 +95,7 @@ final class Router $this->routes[$route][] = [ 'dest' => $destination, 'verb' => $verb, + 'csrf' => $csrf, ]; }