original_string: static function forceInstance(Singleton $object, $class = null)
  	{
  		if($class == null)
  			$class = get_class($object);
  		
  		if(!isset(self::$instances[$class]))
  		{
  			self::$instances[$class] = $object;
  		}
  		else
  		{
  			throw new \Exception(sprintf('Object of class %s was previously instanciated', $class));
  		}
  	}
code: static function forceInstance(Singleton $object, $class = null)
  	{
  		if($class == null)
  			$class = get_class($object);
  		
  		if(!isset(self::$instances[$class]))
  		{
  			self::$instances[$class] = $object;
  		}
  		else
  		{
  			throw new \Exception(sprintf('Object of class %s was previously instanciated', $class));
  		}
  	}
code_tokens: static function forceInstance ( Singleton $ object , $ class = null ) { if ( $ class == null ) $ class = get_class ( $ object ) ; if ( ! isset ( self :: $ instances [ $ class ] ) ) { self :: $ instances [ $ class ] = $ object ; } else { throw new \ Exception ( sprintf ( 'Object of class %s was previously instanciated' , $ class ) ) ; } }
docstring: Force a singleton object to be instanciated with the given instance
  Use with care!
docstring_tokens: Force a singleton object to be instanciated with the given instance Use with care!