src/CallbackContainerBuilder.php
public function registerObject( $serviceName, $instance ) {

		if ( !is_string( $serviceName ) ) {
			throw new InvalidParameterTypeException( "Expected a string" );
		}

		if ( isset( $this->aliases[$serviceName] ) ) {
			throw new ServiceAliasMismatchException( $serviceName );
		}

		unset( $this->singletons[$serviceName] );

		$this->registry[$serviceName] = $instance;
		$this->singletons[$serviceName]['#'] = $instance;
	}
public function registerObject( $serviceName, $instance ) {

		if ( !is_string( $serviceName ) ) {
			throw new InvalidParameterTypeException( "Expected a string" );
		}

		if ( isset( $this->aliases[$serviceName] ) ) {
			throw new ServiceAliasMismatchException( $serviceName );
		}

		unset( $this->singletons[$serviceName] );

		$this->registry[$serviceName] = $instance;
		$this->singletons[$serviceName]['#'] = $instance;
	}
public function registerObject ( $ serviceName , $ instance ) { if ( ! is_string ( $ serviceName ) ) { throw new InvalidParameterTypeException ( "Expected a string" ) ; } if ( isset ( $ this -> aliases [ $ serviceName ] ) ) { throw new ServiceAliasMismatchException ( $ serviceName ) ; } unset ( $ this -> singletons [ $ serviceName ] ) ; $ this -> registry [ $ serviceName ] = $ instance ; $ this -> singletons [ $ serviceName ] [ '#' ] = $ instance ; }
If you are not running PHPUnit or for that matter any other testing
environment then you are not suppose to use this function.

@since 2.0

{@inheritDoc}
If you are not running PHPUnit or for that matter any other testing environment then you are not suppose to use this function .