mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
request interface fixes
This commit is contained in:
@@ -112,6 +112,8 @@ interface Request
|
||||
|
||||
/**
|
||||
* Get a server param value.
|
||||
*
|
||||
* @return ?mixed
|
||||
*/
|
||||
public function getServerParam(string $name);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ class RequestNull implements ApiRequest
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ?string|array
|
||||
*/
|
||||
public function getQueryParam(string $name)
|
||||
{
|
||||
return null;
|
||||
@@ -112,6 +115,9 @@ class RequestNull implements ApiRequest
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ?mixed
|
||||
*/
|
||||
public function getServerParam(string $name)
|
||||
{
|
||||
return null;
|
||||
|
||||
@@ -102,6 +102,9 @@ class RequestWrapper implements ApiRequest
|
||||
return array_key_exists($name, $this->request->getQueryParams());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ?string|array
|
||||
*/
|
||||
public function getQueryParam(string $name)
|
||||
{
|
||||
$value = $this->request->getQueryParams()[$name] ?? null;
|
||||
@@ -192,7 +195,10 @@ class RequestWrapper implements ApiRequest
|
||||
return $params[$name] ?? null;
|
||||
}
|
||||
|
||||
public function getServerParam(string $name) : ?string
|
||||
/**
|
||||
* @return ?mixed
|
||||
*/
|
||||
public function getServerParam(string $name)
|
||||
{
|
||||
$params = $this->request->getServerParams();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user