Robo\Robo::hasContainer PHP Method

hasContainer() public static method

Returns TRUE if the container has been initialized, FALSE otherwise.
public static hasContainer ( ) : boolean
return boolean
    public static function hasContainer()
    {
        return static::$container !== null;
    }

Usage Example

Ejemplo n.º 1
0
 public function init($input, $output, $appName = null, $appVersion = null)
 {
     // If we were not provided a container, then create one
     if (!Robo::hasContainer()) {
         Robo::createDefaultContainer($input, $output, $appName, $appVersion);
         // Automatically register a shutdown function and
         // an error handler when we provide the container.
         $this->installRoboHandlers();
     }
     $app = Robo::application();
     $this->registerRoboFileCommands($app);
     return $app;
 }