Generates the inline definition setup.
string $id:
Definition $definition:
string
private function addServiceInlinedDefinitionsSetup($id, $definition) {
$this->referenceVariables[$id] = new Variable('instance');
$code = '';
$processed = new \SplObjectStorage();
foreach ($this
->getInlinedDefinitions($definition) as $iDefinition) {
if ($processed
->contains($iDefinition)) {
continue;
}
$processed
->offsetSet($iDefinition);
if (!$this
->hasReference($id, $iDefinition
->getMethodCalls(), true) && !$this
->hasReference($id, $iDefinition
->getProperties(), true)) {
continue;
}
$name = (string) $this->definitionVariables
->offsetGet($iDefinition);
$code .= $this
->addServiceMethodCalls(null, $iDefinition, $name);
$code .= $this
->addServiceProperties(null, $iDefinition, $name);
$code .= $this
->addServiceConfigurator(null, $iDefinition, $name);
}
if ('' !== $code) {
$code .= "\n";
}
return $code;
}