protected static function setCachedInstance(MessagePartFactory $instance)
    {
        if (self::$instances === null) {
            self::$instances = [];
        }
        $class = get_called_class();
        self::$instances[$class] = $instance;
    }
protected static function setCachedInstance(MessagePartFactory $instance)
    {
        if (self::$instances === null) {
            self::$instances = [];
        }
        $class = get_called_class();
        self::$instances[$class] = $instance;
    }
protected static function setCachedInstance ( MessagePartFactory $ instance ) { if ( self :: $ instances === null ) { self :: $ instances = [ ] ; } $ class = get_called_class ( ) ; self :: $ instances [ $ class ] = $ instance ; }
Sets a cached singleton instance.

@param MessagePartFactory $instance
Sets a cached singleton instance .