Robo\Robo::getContainer PHP Method

getContainer() public static method

Returns the currently active global container.
public static getContainer ( ) : League\Container\ContainerInterface
return League\Container\ContainerInterface
    public static function getContainer()
    {
        if (static::$container === null) {
            throw new \RuntimeException('container is not initialized yet. \\Robo\\Robo::setContainer() must be called with a real container.');
        }
        return static::$container;
    }

Usage Example

Esempio n. 1
0
 /**
  * Provides direct access to the collection of temporaries, if necessary.
  */
 public static function getCollection()
 {
     if (!static::$collection) {
         static::$collection = \Robo\Robo::getContainer()->get('collection');
         register_shutdown_function(function () {
             static::complete();
         });
     }
     return static::$collection;
 }
All Usage Examples Of Robo\Robo::getContainer