Symfony\Component\DependencyInjection\Dumper\PhpDumper::addServiceInclude PHP Method

addServiceInclude() private method

Generates the require_once statement for service includes.
private addServiceInclude ( string $id, Definition $definition ) : string
$id string The service id
$definition Symfony\Component\DependencyInjection\Definition
return string
    private function addServiceInclude($id, $definition)
    {
        $template = "        require_once %s;\n";
        $code = '';

        if (null !== $file = $definition->getFile()) {
            $code .= sprintf($template, $this->dumpValue($file));
        }

        foreach ($this->getInlinedDefinitions($definition) as $definition) {
            if (null !== $file = $definition->getFile()) {
                $code .= sprintf($template, $this->dumpValue($file));
            }
        }

        if ('' !== $code) {
            $code .= "\n";
        }

        return $code;
    }