Skip to content

feat: [Validation] Callable Rules#7933

Merged
kenjis merged 3 commits into
codeigniter4:4.5from
kenjis:feat-validation-callable
Oct 1, 2023
Merged

feat: [Validation] Callable Rules#7933
kenjis merged 3 commits into
codeigniter4:4.5from
kenjis:feat-validation-callable

Conversation

@kenjis

@kenjis kenjis commented Sep 13, 2023

Copy link
Copy Markdown
Member

Description
For better compatibility to CI3 users.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added enhancement PRs that improve existing functionalities 4.5 labels Sep 13, 2023
Comment thread tests/system/Validation/ValidationTest.php
Comment thread tests/system/Validation/ValidationTest.php
@kenjis kenjis force-pushed the feat-validation-callable branch from d800d77 to fde80eb Compare September 15, 2023 06:40
@kenjis

kenjis commented Sep 15, 2023

Copy link
Copy Markdown
Member Author

Rebased to resolve conflicts in the docs.

If a rule is a callable, there is no way to set param.
So the removed `($param === false)` is always true.

$passed = $param === false ? $rule($value) : $rule($value, $param, $data);
@kenjis kenjis force-pushed the feat-validation-callable branch from fde80eb to a089af6 Compare September 23, 2023 05:07
@kenjis kenjis merged commit 307da97 into codeigniter4:4.5 Oct 1, 2023
@kenjis kenjis deleted the feat-validation-callable branch October 1, 2023 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that improve existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants