lepre / di
A simple Dependency Injection Container, PSR-11 compliant.
1.0.0-alpha1
2019-03-21 10:14 UTC
Requires
- php: ^7.1
- psr/container: ^1.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ^7.0 || ^8.0
Provides
This package is auto-updated.
Last update: 2024-12-06 12:58:20 UTC
README
🚧 This project is in early development stage and it could change significantly in the future.
Lepre DI
A simple Dependency Injection Container, PSR-11 compliant.
Installation
Install the latest version with Composer:
$ composer require lepre/di:dev-master
Requirements
This project works with PHP 7.4 or above.
Basic Usage
use Lepre\DI\Container; $container = new Container(); // register a service: $container->set('my service', function () { return new MyService(); }); // register a service with dependencies: $container->set('other service', function (Container $container) { return new OtherService( $container->get('my service') ); });
License
This project is licensed under the MIT License. See the LICENSE file for details.