magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

PSR-11 Support / Custom factories #43

Open paales opened 6 years ago

paales commented 6 years ago

We're using third party libraries more and more because Magento is pretty much completely compatible with third party libraries. Unfortunately I see more libraries using PSR-11 and that is causing headaches when trying to use those libraries.

For example, I'm using this library: https://github.com/prooph/event-sourcing This library makes use of the ContainerInterface to instantiate its objects.. it would be nice if Magento would support custom factories for objects.

Not sure how that would exactly work, how the config would be used in the config, etc.

Config examples:

Maybe define something like:

<type name="ReachDigital\ProophJira\Infrastructure\Repository\EventStoreUserCollection">
    <factory type="Prooph\EventSourcing\Container\Aggregate\AggregateRepositoryFactory"/>
</type>

This probably needs to be thought out more ;)