mvc:request - allow mixed for $defaultValue so we can pass strings or arrays

This commit is contained in:
Ad Schellevis 2024-06-03 15:48:15 +02:00
parent cad058ef24
commit abec7c49be

View File

@ -111,7 +111,7 @@ class Request
return isset($_POST[$name]);
}
public function getPost(?string $name = null, ?string $filter = null, ?string $defaultValue = null)
public function getPost(?string $name = null, ?string $filter = null, mixed $defaultValue = null)
{
if ($name === null) {
$value = $_POST;
@ -124,7 +124,7 @@ class Request
return $value;
}
public function get(?string $name = null, ?string $filter = null, ?string $defaultValue = null)
public function get(?string $name = null, ?string $filter = null, mixed $defaultValue = null)
{
if ($name === null) {
$value = $_REQUEST;