public static function getInstance($name = 'default')
    {
        if (isset(static::$instances[$name])) {
            return static::$instances[$name];
        }

        $instance = new static();

        static::$instances[$name] = $instance;

        return $instance;
    }
public static function getInstance($name = 'default')
    {
        if (isset(static::$instances[$name])) {
            return static::$instances[$name];
        }

        $instance = new static();

        static::$instances[$name] = $instance;

        return $instance;
    }
public static function getInstance ( $ name = 'default' ) { if ( isset ( static :: $ instances [ $ name ] ) ) { return static :: $ instances [ $ name ] ; } $ instance = new static ( ) ; static :: $ instances [ $ name ] = $ instance ; return $ instance ; }
Get the current instance.

@param  string  $name
@return static
Get the current instance .