public static function container(bool $skipLocatingExternal = false) : ContainerInterface
    {
        if (isset(static::$externalContainer)) {
            return static::$externalContainer;
        }
        if (isset(static::$internalContainer)) {
            return static::$internalContainer;
        }
        if (
            !$skipLocatingExternal
            && ($container = static::locateExternalContainer())
        ) {
            static::injectExternalContainer($container);
            return static::$externalContainer;
        }
        return (static::$internalContainer = new static());
    }
public static function container(bool $skipLocatingExternal = false) : ContainerInterface
    {
        if (isset(static::$externalContainer)) {
            return static::$externalContainer;
        }
        if (isset(static::$internalContainer)) {
            return static::$internalContainer;
        }
        if (
            !$skipLocatingExternal
            && ($container = static::locateExternalContainer())
        ) {
            static::injectExternalContainer($container);
            return static::$externalContainer;
        }
        return (static::$internalContainer = new static());
    }
public static function container ( bool $ skipLocatingExternal = false ) : ContainerInterface { if ( isset ( static :: $ externalContainer ) ) { return static :: $ externalContainer ; } if ( isset ( static :: $ internalContainer ) ) { return static :: $ internalContainer ; } if ( ! $ skipLocatingExternal && ( $ container = static :: locateExternalContainer ( ) ) ) { static :: injectExternalContainer ( $ container ) ; return static :: $ externalContainer ; } return ( static :: $ internalContainer = new static ( ) ) ; }
Get the external or internal dependency injection container.

Creates internal container if no container exists yet and an external
container cannot be found.

@param bool $skipLocatingExternal
True: do not attempt to locate an external container.

@return ContainerInterface
Get the external or internal dependency injection container .