Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 25, 2023
2 parents e2a65b3 + 675ea86 commit 3507812
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '10.8.0';
const VERSION = '10.9.0';

/**
* The base path for the Laravel installation.
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Http/FormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected function getValidatorInstance()
*/
protected function createDefaultValidator(ValidationFactory $factory)
{
$rules = $this->container->call([$this, 'rules']);
$rules = method_exists($this, 'rules') ? $this->container->call([$this, 'rules']) : [];

$validator = $factory->make(
$this->validationData(), $rules,
Expand Down
17 changes: 17 additions & 0 deletions tests/Foundation/FoundationFormRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,15 @@ public function after(InjectedDependency $dep)
], $messages);
}

public function testRequestCanPassWithoutRulesMethod()
{
$request = $this->createRequest([], FoundationTestFormRequestWithoutRulesMethod::class);

$request->validateResolved();

$this->assertEquals([], $request->all());
}

/**
* Catch the given exception thrown from the executor, and return it.
*
Expand Down Expand Up @@ -465,3 +474,11 @@ public function __construct(public $value)
//
}
}

class FoundationTestFormRequestWithoutRulesMethod extends FormRequest
{
public function authorize()
{
return true;
}
}

0 comments on commit 3507812

Please sign in to comment.