laminas / laminas-servicemanager-migration

Migrate your code to laminas-servicemanager 4.x compatibility utilizing Rector rules.
https://docs.laminas.dev/laminas-servicemanager-migration/
BSD 3-Clause "New" or "Revised" License
7 stars 5 forks source link

[RFC]: Extension of use for this component #34

Open froschdesign opened 3 years ago

froschdesign commented 3 years ago

RFC

Q A
Proposed Version(s) >=0.1.0
BC Break? No

Goal

Open the component, for wider use.

Background

At the moment, the use of this component is limited to the migration of code for compatibility with version 4 of laminas-servicemanager.

Considerations

The name of the component is laminas-servicemanager-migration and this can also include adding or removing support for laminas-servicemanager.

Proposal(s)

As an example, a rewrite of factories​ from:

class MyObjectFactory implements FactoryInterface
{
   ​public function __invoke(Interop\Container\ContainerInterface $container, $requestedName, array $options = null)
   ​{
       ​$dependency = $container->get(stdClass::class);
       ​return new MyObject($dependency);
   ​}
}

to:

class MyObjectFactory
{
   ​public function __invoke(Psr\Container\ContainerInterface $container)
   ​{
       ​$dependency = $container->get(stdClass::class);
       ​return new MyObject($dependency);
   ​}
}

and vice versa.

samsonasik commented 3 years ago

that's seems possible with create custom rector rule for this specific use case.