1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-04 23:47:30 +02:00

Update AltoRouter.php for php 8.4

Fix for php8.4
AltoRouter::map(): Implicitly marking parameter $name as nullable is deprecated.
AltoRouter::match(): Implicitly marking parameter $requestUrl as nullable is deprecated.
AltoRouter::match(): Implicitly marking parameter $requestMethod as nullable is deprecated.
This commit is contained in:
Petter
2024-12-16 10:00:57 +01:00
committed by GitHub
parent 36f67da100
commit 71389237e5

View File

@@ -117,7 +117,7 @@ class AltoRouter
* @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
* @throws Exception
*/
public function map(string $method, string $route, $target, string $name = null)
public function map(string $method, string $route, $target, string|null $name = null)
{
$this->routes[] = [$method, $route, $target, $name];
@@ -184,7 +184,7 @@ class AltoRouter
* @param string $requestMethod
* @return array|boolean Array with route information on success, false on failure (no match).
*/
public function match(string $requestUrl = null, string $requestMethod = null)
public function match(string|null $requestUrl = null, string|null $requestMethod = null)
{
$params = [];