phpactor/container

Phpactor's DI Container

2.2.1 2023-03-19 19:13 UTC

This package is auto-updated.

Last update: 2024-04-19 21:33:56 UTC


README

Phpactor's minimal PSR-compliant dependency injection container, featuring tags and parameters

$container = new PhpactorContainer([
     'param1' => 'value1',
     'param2' => 'value2',
     // ...
]);

$container->register('Foobar', function (Container $container) {
    return new MyClass(
        $container->get(SomeOtherClass::class),
        $container->getParameter('param1')
    );
};

Contributing

This package is open source and welcomes contributions! Feel free to open a pull request on this repository.

Support

  • Create an issue on the main Phpactor repository.
  • Join the #phpactor channel on the Slack Symfony Devs channel.