feat: getArray для HttpRequest
This commit is contained in:
parent
aa667d2489
commit
0886109467
1 changed files with 8 additions and 0 deletions
|
|
@ -85,6 +85,14 @@ class HttpRequest extends Collection
|
||||||
return $this->_session;
|
return $this->_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getArray($key, $default = []) {
|
||||||
|
$result = parent::get('data')->get($key, $default);
|
||||||
|
if (is_array($result)) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
function set(string $key, mixed $value): void
|
function set(string $key, mixed $value): void
|
||||||
{
|
{
|
||||||
parent::get('data')->set($key, $value);
|
parent::get('data')->set($key, $value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue