ampproject / ampproject/amp-toolbox-php

Add a possibility to have custom dependencies in Custom Transformer

Open
#198 0 comments 0 reactions 0 assignees View on GitHub
Optimizer
Dominant language
PHP
Stars
74
Forks
25
Avg merge
1d 15h
Merged PRs (30d)
3

Description

What do you think about adding a possibility to have custom dependencies in Custom Transformer? We can allow passing the already created object of Transformer into configuration instead of the class name.

Developing the AMP plugin for Magento 2, I have to use a service similar to Psr\Container\ContainerInterface to support dependency inversion. And it would be nice to have an opportunity to use some libraries by adding them in transformers construct.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Custom Transformer configuration and constructor handling for transformer class names. Review how configuration is validated and how transformers are instantiated, then determine the expected behavior for accepting an already created transformer with its dependencies. Done should be demonstrated by coverage for both class-name and object-based configuration.

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.