src/ServiceProvider/ExtendServiceFromRegistryDefinition.php
public function toPhpCode(string $containerVariable, array $usedVariables = array()): InlineEntryInterface
    {
        $previousCode = '';
        if ($this->previousDefinition) {
            $previousCode = ', '.$this->previousDefinition->toPhpCode($containerVariable, $usedVariables)->getExpression();
        } else {
            $previousCode = ', null';
        }
        $code = sprintf('$this->registry->extendService(%s, %s, $this->delegateLookupContainer%s)', var_export($this->serviceProviderKey, true),
            var_export($this->serviceName, true), $previousCode);

        return new InlineEntry($code, null, $usedVariables);
    }
public function toPhpCode(string $containerVariable, array $usedVariables = array()): InlineEntryInterface
    {
        $previousCode = '';
        if ($this->previousDefinition) {
            $previousCode = ', '.$this->previousDefinition->toPhpCode($containerVariable, $usedVariables)->getExpression();
        } else {
            $previousCode = ', null';
        }
        $code = sprintf('$this->registry->extendService(%s, %s, $this->delegateLookupContainer%s)', var_export($this->serviceProviderKey, true),
            var_export($this->serviceName, true), $previousCode);

        return new InlineEntry($code, null, $usedVariables);
    }
Returns an InlineEntryInterface object representing the PHP code necessary to generate
the container entry.

@param string $containerVariable The name of the variable that allows access to the container instance. For instance: "$container", or "$this->container"
@param array  $usedVariables     An array of variables that are already used and that should not be used when generating this code.

@return InlineEntryInterface