original_string: public function replaceObject($service_id, $callable, $is_factory = false)
  	{
  		if ( !isset($this->container[$service_id]) ) {
  			throw new \InvalidArgumentException('Service "' . $service_id . '" not found');
  		}
  
  		$backup = $this->container->raw($service_id);
  		unset($this->container[$service_id]);
  		$this->container[$service_id] = $is_factory ? $this->container->factory($callable) : $callable;
  
  		return $backup;
  	}
code: public function replaceObject($service_id, $callable, $is_factory = false)
  	{
  		if ( !isset($this->container[$service_id]) ) {
  			throw new \InvalidArgumentException('Service "' . $service_id . '" not found');
  		}
  
  		$backup = $this->container->raw($service_id);
  		unset($this->container[$service_id]);
  		$this->container[$service_id] = $is_factory ? $this->container->factory($callable) : $callable;
  
  		return $backup;
  	}
code_tokens: public function replaceObject ( $ service_id , $ callable , $ is_factory = false ) { if ( ! isset ( $ this -> container [ $ service_id ] ) ) { throw new \ InvalidArgumentException ( 'Service "' . $ service_id . '" not found' ) ; } $ backup = $ this -> container -> raw ( $ service_id ) ; unset ( $ this -> container [ $ service_id ] ) ; $ this -> container [ $ service_id ] = $ is_factory ? $ this -> container -> factory ( $ callable ) : $ callable ; return $ backup ; }
docstring: Replaces object in the container.
  
  @param string   $service_id Name of the object in the container.
  @param callable $callable   The callable that will return the object.
  @param boolean  $is_factory The callable should be considered as a factory.
  
  @return callable Previous service version.
  @throws \InvalidArgumentException When attempt is made to replace non-existing service.
docstring_tokens: Replaces object in the container .