src/ContainerBuilder.php
private function generateArgumentsCode(ServiceArguments $arguments) : string
    {
        $buffer = [];

        foreach($arguments->getAll() as list($argumentValue, $argumentType))
        {
            if ($argumentType === ServiceArguments::DEPENDENCY)
            {
                if ($argumentValue === 'container')
                {
                    $buffer[] = "\$this";
                }
                // if the dependency is defined in the current container builder
                // we can be sure that it exists and directly call the resolver method
                elseif (isset($this->services[$argumentValue])) 
                {
                    $resolverMethodCall = "\$this->" . $this->getResolverMethodName($argumentValue) . '()';

                    // if is not shared we can just forward the factory method
                    if (!in_array($argumentValue, $this->shared))
                    {
                        $buffer[] = $resolverMethodCall;
                    }
                    // otherwise we have to check if the singleton has 
                    // already been resolved.
                    else
                    {
                        $buffer[] = "\$this->resolvedSharedServices['$argumentValue'] ?? \$this->resolvedSharedServices['$argumentValue'] = " . $resolverMethodCall;
                    }   
                }
                // if the dependency is not defined inside the container builder
                // it might be added dynamically later. So we just access the containers `get` method.
                else
                {
                    $buffer[] = "\$this->get('$argumentValue')";
                }
            }
            elseif ($argumentType === ServiceArguments::PARAMETER)
            {
                $buffer[] = "\$this->getParameter('$argumentValue')";
            }
            elseif ($argumentType === ServiceArguments::RAW)
            {
                $buffer[] = var_export($argumentValue, true);
            }
        }

        return implode(', ', $buffer);
    }
private function generateArgumentsCode(ServiceArguments $arguments) : string
    {
        $buffer = [];

        foreach($arguments->getAll() as list($argumentValue, $argumentType))
        {
            if ($argumentType === ServiceArguments::DEPENDENCY)
            {
                if ($argumentValue === 'container')
                {
                    $buffer[] = "\$this";
                }
                // if the dependency is defined in the current container builder
                // we can be sure that it exists and directly call the resolver method
                elseif (isset($this->services[$argumentValue])) 
                {
                    $resolverMethodCall = "\$this->" . $this->getResolverMethodName($argumentValue) . '()';

                    // if is not shared we can just forward the factory method
                    if (!in_array($argumentValue, $this->shared))
                    {
                        $buffer[] = $resolverMethodCall;
                    }
                    // otherwise we have to check if the singleton has 
                    // already been resolved.
                    else
                    {
                        $buffer[] = "\$this->resolvedSharedServices['$argumentValue'] ?? \$this->resolvedSharedServices['$argumentValue'] = " . $resolverMethodCall;
                    }   
                }
                // if the dependency is not defined inside the container builder
                // it might be added dynamically later. So we just access the containers `get` method.
                else
                {
                    $buffer[] = "\$this->get('$argumentValue')";
                }
            }
            elseif ($argumentType === ServiceArguments::PARAMETER)
            {
                $buffer[] = "\$this->getParameter('$argumentValue')";
            }
            elseif ($argumentType === ServiceArguments::RAW)
            {
                $buffer[] = var_export($argumentValue, true);
            }
        }

        return implode(', ', $buffer);
    }
Generate arguments code

@param ServiceArguments          $arguments
@return string