Skip to content

Commit 3507812

Browse files
committed
fix conflicts
2 parents e2a65b3 + 675ea86 commit 3507812

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/Illuminate/Foundation/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
3838
*
3939
* @var string
4040
*/
41-
const VERSION = '10.8.0';
41+
const VERSION = '10.9.0';
4242

4343
/**
4444
* The base path for the Laravel installation.

src/Illuminate/Foundation/Http/FormRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ protected function getValidatorInstance()
116116
*/
117117
protected function createDefaultValidator(ValidationFactory $factory)
118118
{
119-
$rules = $this->container->call([$this, 'rules']);
119+
$rules = method_exists($this, 'rules') ? $this->container->call([$this, 'rules']) : [];
120120

121121
$validator = $factory->make(
122122
$this->validationData(), $rules,

tests/Foundation/FoundationFormRequestTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,15 @@ public function after(InjectedDependency $dep)
204204
], $messages);
205205
}
206206

207+
public function testRequestCanPassWithoutRulesMethod()
208+
{
209+
$request = $this->createRequest([], FoundationTestFormRequestWithoutRulesMethod::class);
210+
211+
$request->validateResolved();
212+
213+
$this->assertEquals([], $request->all());
214+
}
215+
207216
/**
208217
* Catch the given exception thrown from the executor, and return it.
209218
*
@@ -465,3 +474,11 @@ public function __construct(public $value)
465474
//
466475
}
467476
}
477+
478+
class FoundationTestFormRequestWithoutRulesMethod extends FormRequest
479+
{
480+
public function authorize()
481+
{
482+
return true;
483+
}
484+
}

0 commit comments

Comments
 (0)