WPZylos Container

PSR-11 compliant dependency injection container with auto-wiring.

What You Get

  • PSR-11 compliance — Works with any PSR-11 compatible library
  • Auto-wiring — Automatic dependency resolution via reflection
  • Singleton & transient bindings — Control instance lifecycle
  • Service tagging — Group and retrieve related services by tag
  • No compilation — Runtime resolution, no cache warmup needed

Quick Start

use WPZylos\Framework\Container\Container;

$container = new Container();

// Bind interface to implementation
$container->bind(LoggerInterface::class, FileLogger::class);

// Singleton binding
$container->singleton(Database::class, function ($c) {
    return new Database($c->get(Config::class));
});

// Resolve with auto-wiring
$controller = $container->get(UserController::class);

Documentation