Pressbooks\Container::getPimple PHP Method

getPimple() static public method

static public getPimple ( ) : Pimple\Container
return Pimple\Container
    static function getPimple()
    {
        if (!static::$pimple) {
            throw new \LogicException('\\Pimple\\Container not set, call init() or setPimple() before using getPimple().');
        }
        return static::$pimple;
    }

Usage Example

Example #1
0
 /**
  * @covers \Pressbooks\Container::getPimple
  */
 public function test_getPimpleException()
 {
     $this->setExpectedException('\\LogicException');
     $p = Container::getPimple();
 }