public function __construct(IContext $context, ICacheStorage $cacheStorage, Configuration $configuration) { $this->context = $context; $this->cache = new Cache($cacheStorage, static::class); $this->context->register(new SingletonFactory($this, IStorage::class)); }
public static function boot() { self::$context = new Context($eventBus = new EventBus()); $eventBus->register(self::$context); self::$context->register(new SingletonFactory($eventBus, IEventBus::class)); }