Пример #1
0
 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));
 }
Пример #2
0
 public static function boot()
 {
     self::$context = new Context($eventBus = new EventBus());
     $eventBus->register(self::$context);
     self::$context->register(new SingletonFactory($eventBus, IEventBus::class));
 }