Skip to content

Refactor configuration to immutable types#103

Open
tux-rampage wants to merge 3 commits intolaminas:3.17.xfrom
tux-rampage:feature/typed-config
Open

Refactor configuration to immutable types#103
tux-rampage wants to merge 3 commits intolaminas:3.17.xfrom
tux-rampage:feature/typed-config

Conversation

@tux-rampage
Copy link
Member

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC yes
QA yes

Description

In preparation for #95, this PR will refactor the configuration to immutable types to follow a parse over validate strategy and to declare the configuration structure type safe in code.

Since the configuration should be considered immutable, the setParameters() method needs to be deprecated.
A possible BC-Break is that it will throw an Exception when called. However, user's can opt-in into the mutable config behavior by setting a config option. The message of the thrown exception will also hint to it.

The config method getConfiguredTypeNames() is also deprecated in favor of extracting the code generation to a separate package. It is not needed at runtime.

@tux-rampage tux-rampage self-assigned this Jun 13, 2025
@tux-rampage tux-rampage added RFC QA Quality assurance tasks such as static analysis improvements labels Jun 13, 2025
@tux-rampage tux-rampage requested a review from a team June 13, 2025 10:23
Signed-off-by: tux-rampage <tuxrampage@gmail.com>
Signed-off-by: tux-rampage <tuxrampage@gmail.com>
@tux-rampage tux-rampage changed the base branch from 3.16.x to 3.17.x February 5, 2026 11:19
* @see \Laminas\Di\Resolver\ValueInjection A container to force injection of a value
* @see \Laminas\Di\Resolver\TypeInjection A container to force looking up a specific type instance for injection
*
* @readonly
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, this can now be marked readonly via the language itself

Copy link
Member Author

Choose a reason for hiding this comment

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

Since support for php 8.1 is now gone, indeed.

Signed-off-by: tux-rampage <tuxrampage@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Quality assurance tasks such as static analysis improvements RFC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants