original_string: public function addSingleton( string $name, $singleton ): self
  	{
  		$name = Str::studly($name);
  		if( isset($this->ci[$name]) )
  		{
  			throw new \InvalidArgumentException("Duplicated class name '{$name}' for singleton instance object");
  		}
  
  		$this->ci[$name] = $singleton;
  		return $this;
  	}
code: public function addSingleton( string $name, $singleton ): self
  	{
  		$name = Str::studly($name);
  		if( isset($this->ci[$name]) )
  		{
  			throw new \InvalidArgumentException("Duplicated class name '{$name}' for singleton instance object");
  		}
  
  		$this->ci[$name] = $singleton;
  		return $this;
  	}
code_tokens: public function addSingleton ( string $ name , $ singleton ) : self { $ name = Str :: studly ( $ name ) ; if ( isset ( $ this -> ci [ $ name ] ) ) { throw new \ InvalidArgumentException ( "Duplicated class name '{$name}' for singleton instance object" ) ; } $ this -> ci [ $ name ] = $ singleton ; return $ this ; }
docstring: Add new singleton
  
  @param string|object $name
  @param $singleton
  @return SingletonEvent
docstring_tokens: Add new singleton