eee
This commit is contained in:
@@ -803,6 +803,35 @@ class Request implements ServerRequestInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $name
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function has(string $name): bool
|
||||||
|
{
|
||||||
|
return $this->request($name,null) !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $name
|
||||||
|
* @param mixed|null $value
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function request(string $name, mixed $value = null): mixed
|
||||||
|
{
|
||||||
|
$parseBody = $this->getParsedBody();
|
||||||
|
$queryParams = $this->getQueryParams();
|
||||||
|
if (isset($queryParams[$name])) {
|
||||||
|
return $queryParams[$name];
|
||||||
|
}
|
||||||
|
if (isset($parseBody[$name])) {
|
||||||
|
return $parseBody[$name];
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user