This package offers a reference implementation all the Ioc-Interop interface to present a typical "open" autowired container.
$ composer require ioc-interop/impl
use IocInterop\Impl\Container;
use IocInterop\Interface\IocContainer;
$ioc = new Container();$foo = $ioc->getService(Foo::class);$ioc->setService(Foo::class, new Foo());$ioc->setAlias('foo.foo', Foo::class);
$foo = $ioc->getService('foo.foo');$ioc->getDefinition(Foo::class)
->setFactory(fn (IocContainer $ioc) : Foo => return new Foo());$ioc->getDefinition(Foo::class)
->addExtender(function (IocContainer $ioc, Foo $foo) : Foo {
$foo->bar = 'baz';
return $foo;
});