|
@@ -119,7 +119,7 @@ class Request implements Stringable
|
|
|
* @param mixed $default
|
|
* @param mixed $default
|
|
|
* @return mixed
|
|
* @return mixed
|
|
|
*/
|
|
*/
|
|
|
- public function get(string $name = null, mixed $default = null): mixed
|
|
|
|
|
|
|
+ public function get(?string $name = null, mixed $default = null): mixed
|
|
|
{
|
|
{
|
|
|
if (!isset($this->data['get'])) {
|
|
if (!isset($this->data['get'])) {
|
|
|
$this->parseGet();
|
|
$this->parseGet();
|
|
@@ -137,7 +137,7 @@ class Request implements Stringable
|
|
|
* @param mixed $default
|
|
* @param mixed $default
|
|
|
* @return mixed
|
|
* @return mixed
|
|
|
*/
|
|
*/
|
|
|
- public function post(string $name = null, mixed $default = null): mixed
|
|
|
|
|
|
|
+ public function post(?string $name = null, mixed $default = null): mixed
|
|
|
{
|
|
{
|
|
|
if (!isset($this->data['post'])) {
|
|
if (!isset($this->data['post'])) {
|
|
|
$this->parsePost();
|
|
$this->parsePost();
|
|
@@ -155,7 +155,7 @@ class Request implements Stringable
|
|
|
* @param mixed $default
|
|
* @param mixed $default
|
|
|
* @return mixed
|
|
* @return mixed
|
|
|
*/
|
|
*/
|
|
|
- public function header(string $name = null, mixed $default = null): mixed
|
|
|
|
|
|
|
+ public function header(?string $name = null, mixed $default = null): mixed
|
|
|
{
|
|
{
|
|
|
if (!isset($this->data['headers'])) {
|
|
if (!isset($this->data['headers'])) {
|
|
|
$this->parseHeaders();
|
|
$this->parseHeaders();
|
|
@@ -174,7 +174,7 @@ class Request implements Stringable
|
|
|
* @param mixed $default
|
|
* @param mixed $default
|
|
|
* @return mixed
|
|
* @return mixed
|
|
|
*/
|
|
*/
|
|
|
- public function cookie(string $name = null, mixed $default = null): mixed
|
|
|
|
|
|
|
+ public function cookie(?string $name = null, mixed $default = null): mixed
|
|
|
{
|
|
{
|
|
|
if (!isset($this->data['cookie'])) {
|
|
if (!isset($this->data['cookie'])) {
|
|
|
$this->data['cookie'] = [];
|
|
$this->data['cookie'] = [];
|
|
@@ -192,7 +192,7 @@ class Request implements Stringable
|
|
|
* @param string|null $name
|
|
* @param string|null $name
|
|
|
* @return array|null
|
|
* @return array|null
|
|
|
*/
|
|
*/
|
|
|
- public function file(string $name = null)
|
|
|
|
|
|
|
+ public function file(?string $name = null)
|
|
|
{
|
|
{
|
|
|
if (!isset($this->data['files'])) {
|
|
if (!isset($this->data['files'])) {
|
|
|
$this->parsePost();
|
|
$this->parsePost();
|
|
@@ -295,7 +295,7 @@ class Request implements Stringable
|
|
|
* @return string
|
|
* @return string
|
|
|
* @throws Exception
|
|
* @throws Exception
|
|
|
*/
|
|
*/
|
|
|
- public function sessionId(string $sessionId = null): string
|
|
|
|
|
|
|
+ public function sessionId(?string $sessionId = null): string
|
|
|
{
|
|
{
|
|
|
if ($sessionId) {
|
|
if ($sessionId) {
|
|
|
unset($this->sid);
|
|
unset($this->sid);
|