Skip to content

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

Merged
samsonasik merged 1 commit into
codeigniter4:developfrom
samsonasik:refactor-more-strict
Jan 2, 2025
Merged

refactor: use more strict result check on preg_match_all() result#9361
samsonasik merged 1 commit into
codeigniter4:developfrom
samsonasik:refactor-more-strict

Conversation

@samsonasik

Copy link
Copy Markdown
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

@samsonasiksamsonasik changed the title refactor: use more strict result on preg_match_all() resultrefactor: use more strict result check on preg_match_all() resultJan 1, 2025
@samsonasik

Copy link
Copy Markdown
MemberAuthor

Ready to merge 👍

@neznaika0neznaika0 left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
MemberAuthor

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

@samsonasik

Copy link
Copy Markdown
MemberAuthor

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

@samsonasik
samsonasik merged commit 3c851f1 into codeigniter4:developJan 2, 2025
@samsonasik
samsonasik deleted the refactor-more-strict branch January 2, 2025 01:15
@kenjiskenjis added the refactor Pull requests that refactor code label Jan 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactorPull requests that refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@samsonasik@michalsn@neznaika0@kenjis