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

fix(transformer): change the way transformer factory are injected to make it work as soon as automapper is created #48

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

joelwurtz
Copy link
Member

This fix #4

Mainly the issue is we don't know in which order the process / addTransformerFactory will be done in the DIC of Symfony.

To havoid doing something complicated in the bundle i change the way factories are created.

So now they can be created before the automapper, and registry / chain transformer will be set when they are injected.

This also allow only implementating an interface to have the registry / chain set and will simplify DIC configuration in the bundle

Now when we do new AutoMapper() it should be ready instantly

@joelwurtz joelwurtz force-pushed the feat/transformer-factory-aware branch from 42f2464 to 12b7361 Compare March 9, 2024 09:54
Copy link
Member

@Korbeil Korbeil left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Thanks for the new feature !
Some comments mostly about deprecation warninigs.

src/AutoMapperRegistryAwareInterface.php Show resolved Hide resolved
src/AutoMapper.php Outdated Show resolved Hide resolved
src/Transformer/ChainTransformerFactory.php Outdated Show resolved Hide resolved
src/Transformer/ChainTransformerFactory.php Outdated Show resolved Hide resolved
Copy link
Collaborator

@nikophil nikophil left a comment

Choose a reason for hiding this comment

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

LGTM

@joelwurtz joelwurtz force-pushed the feat/transformer-factory-aware branch from 12b7361 to 256eb4c Compare March 11, 2024 09:02
…make it work as soon as automapper is created
@joelwurtz joelwurtz force-pushed the feat/transformer-factory-aware branch from 256eb4c to 18a9f2e Compare March 11, 2024 09:16
@joelwurtz joelwurtz merged commit b0dcc81 into main Mar 11, 2024
10 checks passed
@joelwurtz joelwurtz deleted the feat/transformer-factory-aware branch March 14, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ObjectTransformer is not available when custom MapperConfigurationInterface is processed
3 participants