Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [Validation] Callable Rules #7933

Merged
merged 3 commits into from
Oct 1, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Sep 13, 2023

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
@kenjis kenjis force-pushed the feat-validation-callable branch from d800d77 to fde80eb Compare September 15, 2023 06:40
@kenjis
Copy link
Member Author

kenjis commented Sep 15, 2023

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
63 checks passed
@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
4.5 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants