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

refactor: use more strict result check on preg_match_all() result #9361

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

samsonasik
Copy link
Member

Description

Continue of PR:

this ensure preg_match_all() which with falsy check ensure got exact equal result, wich compare to >=1 or <1 which can be false or 0.

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

@samsonasik samsonasik changed the title refactor: use more strict result on preg_match_all() result refactor: use more strict result check on preg_match_all() result Jan 1, 2025
@samsonasik
Copy link
Member Author

Ready to merge 👍

Copy link
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Why not > 0 ?

@samsonasik
Copy link
Member Author

that's to make consistent with negation, if 0 or false, it uses < 1, so >=1 is chosen for found.

@samsonasik
Copy link
Member Author

Thank you @michalsn @neznaika0 for the review, let's merge 👍

@samsonasik samsonasik merged commit 3c851f1 into codeigniter4:develop Jan 2, 2025
41 checks passed
@samsonasik samsonasik deleted the refactor-more-strict branch January 2, 2025 01:15
@kenjis kenjis added the refactor Pull requests that refactor code label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants