Skip to content

Commit

Permalink
support older PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Sep 28, 2022
1 parent 7b6c1d1 commit 9652e72
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/Integration/Routing/PrecognitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -875,13 +875,18 @@ class PrecognitionTestRequest extends FormRequest
{
public function rules()
{
return [
$rules = [
'required_integer' => 'required|integer',
...! $this->isPrecognitive() ? ['required_integer_when_not_precognitive' => 'required|integer'] : [],
'optional_integer_1' => 'integer',
'optional_integer_2' => 'integer',
' input with spaces ' => 'integer',
];

if (! $this->isPrecognitive()) {
$rules['required_integer_when_not_precognitive'] = 'required|integer';
}

return $rules;
}
}

Expand Down

0 comments on commit 9652e72

Please sign in to comment.