evyex / container-simple
Simple container (DI)
1.3
2026-05-11 09:19 UTC
Requires
- php: ^8.1
- psr/container: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpunit/phpunit: >=10.0
README
Simple PHP Dependency Injection Container implementing PSR-11 ContainerInterface with Autowiring and Recursion resolving.
Installation
composer require evyex/container-simple
Usage
use Evyex\ContainerSimple\Container; $container = new Container(); // Get a service (auto-resolves dependencies) $service = $container->get(MyService::class); // Check if a service exists if ($container->has(MyService::class)) { // ... }
Features
- Autowiring
- ContainerInterface compliant (PSR-11)
- Lightweight
- Recursion resolving
Requirements
- PHP ^8.1
- psr/container ^2.0