Skip to content

Commit 6bf52b1

Browse files
committed
fix FormRequest contructor
1 parent d676085 commit 6bf52b1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

system/HTTP/FormRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class FormRequest
3939
* explicitly. When instantiated manually (e.g. in tests), the constructor
4040
* falls back to service('request').
4141
*/
42-
final public function __construct(?IncomingRequest $request = null)
42+
final public function __construct(?Request $request = null)
4343
{
4444
$request ??= service('request');
4545

tests/system/HTTP/FormRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function testConstructorThrowsWhenFallbackRequestIsNotIncomingRequest():
135135
Services::injectMock('request', new CLIRequest(new App()));
136136

137137
$this->expectException(RuntimeException::class);
138-
$this->expectExceptionMessage('requires an IncomingRequest instance');
138+
$this->expectExceptionMessage('requires an IncomingRequest instance, got CodeIgniter\HTTP\CLIRequest.');
139139

140140
new class () extends FormRequest {
141141
public function rules(): array

0 commit comments

Comments
 (0)