Skip to content

Comments

feat: add new dot-path array helpers#9990

Open
michalsn wants to merge 5 commits intocodeigniter4:4.8from
michalsn:feat/array-helper-extended
Open

feat: add new dot-path array helpers#9990
michalsn wants to merge 5 commits intocodeigniter4:4.8from
michalsn:feat/array-helper-extended

Conversation

@michalsn
Copy link
Member

Description
This PR:

  • Adds five new dot-syntax helper functions: dot_array_has(), dot_array_set(), dot_array_unset(), dot_array_only(), and dot_array_except(), each backed by a corresponding ArrayHelper static method.
  • Renames ArrayHelper::dotKeyExists() to dotHas() and updates all callers, including Validation/Rules.php and Validation/StrictRules/Rules.php. This is a safe change since ArrayHelper is marked as @internal.
  • Adds a fast path in ArrayHelper::convertToArray() that uses explode() for the common case (no escaped dots), avoiding PCRE engine overhead.

Checklist:

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

@michalsn michalsn added enhancement PRs that improve existing functionalities 4.8 PRs that target the `4.8` branch. labels Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.8 PRs that target the `4.8` branch. enhancement PRs that improve existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant