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;
	}
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;
	}
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 ; }
Add new singleton

@param string|object $name
@param $singleton
@return SingletonEvent
Add new singleton