Skip to content

feat: add optional merge directives for registrars#10329

Open
michalsn wants to merge 2 commits into
codeigniter4:4.8from
michalsn:feat/registrars-merge-directives
Open

feat: add optional merge directives for registrars#10329
michalsn wants to merge 2 commits into
codeigniter4:4.8from
michalsn:feat/registrars-merge-directives

Conversation

@michalsn

Copy link
Copy Markdown
Member

Description
This PR adds optional CodeIgniter\Config\Merge directives for Registrars, allowing packages and modules to explicitly control how registrar values are merged into existing config properties.

The default registrar behavior remains unchanged and backward compatible: plain array values still use the current shallow merge behavior. Projects and packages that do not need finer control can continue using registrars exactly as before.

For cases that need more precise behavior, registrars can now opt into replacing values, merging nested arrays by key, appending or prepending list items, or positioning list items before or after an anchor.

Closes #9231

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 Jun 20, 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