Skip to content

Commit

Permalink
Merge branch 'master' into 3.1-merge
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/http-server/src/Response.php
  • Loading branch information
limingxinleo committed Oct 27, 2023
2 parents 23cc11c + 00c5173 commit 0b3104f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Request/FormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ public function setContainer(ContainerInterface $container): static
return $this;
}

public function rules(): array
{
return [];
}

/**
* Get the validator instance for the request.
*/
Expand Down Expand Up @@ -196,7 +201,7 @@ protected function getContextValidatorKey(string $key): string
*/
protected function getRules(): array
{
$rules = call_user_func_array([$this, 'rules'], []);
$rules = $this->rules();
$scene = $this->getScene();
if ($scene && isset($this->scenes[$scene]) && is_array($this->scenes[$scene])) {
return Arr::only($rules, $this->scenes[$scene]);
Expand Down

0 comments on commit 0b3104f

Please sign in to comment.