protected function setInstance(string $name, $object):bool
    {
        if (!isset(self::$instances[$name])) {
            self::$instances[$name] = $object;
            return (true);
        }
        throw new Server500(new \ArrayObject(array("explain" => "Cannot redeclare instance name $name as new instance",
            "solution" => "Please use SingletonMulPattern correctly")));
    }
protected function setInstance(string $name, $object):bool
    {
        if (!isset(self::$instances[$name])) {
            self::$instances[$name] = $object;
            return (true);
        }
        throw new Server500(new \ArrayObject(array("explain" => "Cannot redeclare instance name $name as new instance",
            "solution" => "Please use SingletonMulPattern correctly")));
    }
protected function setInstance ( string $ name , $ object ) : bool { if ( ! isset ( self :: $ instances [ $ name ] ) ) { self :: $ instances [ $ name ] = $ object ; return ( true ) ; } throw new Server500 ( new \ ArrayObject ( array ( "explain" => "Cannot redeclare instance name $name as new instance" , "solution" => "Please use SingletonMulPattern correctly" ) ) ) ; }
Set a new instance in instance mapping
@param string $name Instance name
@param mixed $object Instance object
@return bool True if instance has been setted in instance mapping
@throws Server500 If instance has been redeclared
Set a new instance in instance mapping