magento / magento/community-features

PSR-11 Support / Custom factories

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority: P4
Dominant language
No language data
Stars
46
Forks
14
PR merge metrics
No merged PRs in 30d

Description

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 ;)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the PSR-11 use case and the linked Zend prooph.global.php and Symfony services.yaml configuration examples. Define how Magento configuration would support custom factories and what the expected behavior and acceptance tests should be before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.