コード例 #1
0
 /**
  * Get the DI container.
  *
  * @return  Container
  *
  * @since   1.0
  * @throws  \UnexpectedValueException May be thrown if the container has not been set.
  */
 public function getContainer()
 {
     if (!$this->container) {
         $this->container = Container::getInstance();
     }
     return $this->container;
 }
コード例 #2
0
ファイル: Action.php プロジェクト: beingsane/quickcontent
 /**
  * Contructor.
  *
  * @param Container $container
  */
 public function __construct(Container $container = null)
 {
     $this->container = $container ?: Container::getInstance();
 }