/**
  * Initialize container and facades. Container instance is used static by FacadeFactory::getContainer
  * @return $this
  */
 protected function initContainer()
 {
     if (!FacadeFactory::getContainer() instanceof ContainerInterface) {
         FacadeFactory::setContainer($this->getContainer() instanceof ContainerInterface ? $this->getContainer() : new Container());
     }
     return $this;
 }
Пример #2
0
 /**
  * Get attached instance
  * @return mixed
  * @throws Exception
  */
 public static function __instance()
 {
     return FacadeFactory::getContainer()->get(static::accessor());
 }
 /**
  * @return ContainerInterface
  */
 public function getContainer()
 {
     return FacadeFactory::getContainer();
 }