bigbit / di-bootstrap
App DI Container bootstrapping
v2.0.1
2020-04-01 12:18 UTC
Requires
- php: ^7.4.0
- psr/container: ^1.0
Requires (Dev)
- phpstan/phpstan: ^0.11.15
- phpunit/phpunit: ^8.2
Suggests
- bigbit/oddin: ^2.0.0
- bigbit/smart-di: ^2.0.2
README
App DI Container bootstrapping with dependencies for PHP7.4
Example
use BigBIT\DIBootstrap\Bootstrap; Bootstrap::useVendorPath(dirname(__DIR__) . DIRECTORY_SEPARATOR . "vendor"); Bootstrap::useContainerImplementation(BigBIT\SmartDI\SmartContainer::class); $bindings = [ SomeInterface::class => function(ContainerInterface $container) { return new SomeImplementation($container); } ]; $container = Bootstrap::getContainer(); $app = new App($container); $app->run();