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

Provide default serializer via configuration #39

Merged
merged 2 commits into from
Aug 29, 2023

Conversation

boesing
Copy link
Member

@boesing boesing commented Aug 29, 2023

Q A
Documentation no (will be part of dedicated PR)
Bugfix no
BC Break yes
New Feature yes

Description

Providing retrievable Laminas\Serializer\AdapterInterface service so that projects can fetch that service to retrieve the projects default serializer.

This also removes Laminas\Serializer\Serializer which provided registry-like methods like Serializer#setDefaultSerializer, Serializer#getDefaultSerializer or factories for serializers which are meant to be known or which can also be retrieved by using the AdapterPluginManager#build method instead.

Closes #24


Rationale of removing the Serializer class:

Static classes providing runtime features such as holding default serializers or generic factories are not supported by laminas anymore. If there is a strong need for this kind of logic, projects can write their own registry to persist these kinds of defaults.

Laminas components are primarily meant to be used in projects with dependency injection. Retrieving and replacing default serializers via the container configuration will always be an option.

Static classes providing runtime features such as holding default serializers or generic factories are not supported by laminas anymore. If there is a strong need for this kind of logic, projects can write their own registry to persist these kinds of defaults.

Laminas components are primarily meant to be used in projects with dependency injection. Retrieving and replacing default serializers via the container configuration will always be an option.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
… serializer to the container config

By adding `AdapterInterface` as a service, a default serializer can both be retrieved and configured in projects using dependency injection and `laminas-servicemanager` _compatible_ dependency configurations.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing boesing added this to the 3.0.0 milestone Aug 29, 2023
@boesing boesing merged commit a6541bb into laminas:3.0.x Aug 29, 2023
@boesing boesing deleted the feature/default-serializer branch August 29, 2023 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: Drop support for default serialization and static serializer factory
1 participant