From a8c69e87a46b33c3eaedd6cbbeade5022910617a Mon Sep 17 00:00:00 2001 From: daycry Date: Mon, 29 Aug 2022 17:26:38 +0200 Subject: [PATCH 1/4] - FIX: in command prompt at SYSTEMPATH\Validation\FileRules.php:42 Backtrace: 1 [internal function] CodeIgniter\Debug\Exceptions()->errorHandler(2, 'assert(): assert($request instanceof IncomingRequest) failed', 'C:\\laragon\\www\\test\\vendor\\codeigniter4\\framework\\system\\Validation\\FileRules.php', 42, [...]) --- system/Validation/FileRules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Validation/FileRules.php b/system/Validation/FileRules.php index aec9d9efa2a4..ea3b8030b7aa 100644 --- a/system/Validation/FileRules.php +++ b/system/Validation/FileRules.php @@ -39,7 +39,7 @@ public function __construct(?RequestInterface $request = null) $request = Services::request(); } - assert($request instanceof IncomingRequest); + assert($request instanceof Request); $this->request = $request; } From 8e1e695cb92f47fd16559dc87d7a34eee2f6733a Mon Sep 17 00:00:00 2001 From: daycry Date: Tue, 30 Aug 2022 09:20:38 +0200 Subject: [PATCH 2/4] Update FileRules.php --- system/Validation/FileRules.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/Validation/FileRules.php b/system/Validation/FileRules.php index ea3b8030b7aa..d1e470171b7e 100644 --- a/system/Validation/FileRules.php +++ b/system/Validation/FileRules.php @@ -12,6 +12,7 @@ namespace CodeIgniter\Validation; use CodeIgniter\HTTP\IncomingRequest; +use CodeIgniter\HTTP\CLIRequest; use CodeIgniter\HTTP\Request; use CodeIgniter\HTTP\RequestInterface; use Config\Mimes; @@ -39,7 +40,7 @@ public function __construct(?RequestInterface $request = null) $request = Services::request(); } - assert($request instanceof Request); + assert($request instanceof CLIRequest ?? IncomingRequest) $this->request = $request; } From 9e34a8f4492bb1a03c37a363388818b3398f6de1 Mon Sep 17 00:00:00 2001 From: daycry Date: Tue, 30 Aug 2022 09:42:03 +0200 Subject: [PATCH 3/4] Update FileRules.php --- system/Validation/FileRules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Validation/FileRules.php b/system/Validation/FileRules.php index d1e470171b7e..96c3071e151f 100644 --- a/system/Validation/FileRules.php +++ b/system/Validation/FileRules.php @@ -40,7 +40,7 @@ public function __construct(?RequestInterface $request = null) $request = Services::request(); } - assert($request instanceof CLIRequest ?? IncomingRequest) + assert($request instanceof IncomingRequest || $request instanceof CLIRequest); $this->request = $request; } From 426873f6a6c110dcebb0fafb96971757c13187e5 Mon Sep 17 00:00:00 2001 From: daycry Date: Tue, 30 Aug 2022 10:00:45 +0200 Subject: [PATCH 4/4] Update FileRules.php --- system/Validation/FileRules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Validation/FileRules.php b/system/Validation/FileRules.php index 96c3071e151f..ba054d134b6b 100644 --- a/system/Validation/FileRules.php +++ b/system/Validation/FileRules.php @@ -11,8 +11,8 @@ namespace CodeIgniter\Validation; -use CodeIgniter\HTTP\IncomingRequest; use CodeIgniter\HTTP\CLIRequest; +use CodeIgniter\HTTP\IncomingRequest; use CodeIgniter\HTTP\Request; use CodeIgniter\HTTP\RequestInterface; use Config\Mimes;