|
@@ 178-195 (lines=18) @@
|
| 175 |
|
$definition->setArguments($this->getArgumentsAsPhp($service, 'argument')); |
| 176 |
|
$definition->setProperties($this->getArgumentsAsPhp($service, 'property')); |
| 177 |
|
|
| 178 |
|
if ($factories = $this->getChildren($service, 'factory')) { |
| 179 |
|
$factory = $factories[0]; |
| 180 |
|
if ($function = $factory->getAttribute('function')) { |
| 181 |
|
$definition->setFactory($function); |
| 182 |
|
} else { |
| 183 |
|
$factoryService = $this->getChildren($factory, 'service'); |
| 184 |
|
|
| 185 |
|
if (isset($factoryService[0])) { |
| 186 |
|
$class = $this->parseDefinition($factoryService[0], $file); |
| 187 |
|
} elseif ($childService = $factory->getAttribute('service')) { |
| 188 |
|
$class = new Reference($childService, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false); |
| 189 |
|
} else { |
| 190 |
|
$class = $factory->getAttribute('class'); |
| 191 |
|
} |
| 192 |
|
|
| 193 |
|
$definition->setFactory(array($class, $factory->getAttribute('method'))); |
| 194 |
|
} |
| 195 |
|
} |
| 196 |
|
|
| 197 |
|
if ($configurators = $this->getChildren($service, 'configurator')) { |
| 198 |
|
$configurator = $configurators[0]; |
|
@@ 197-214 (lines=18) @@
|
| 194 |
|
} |
| 195 |
|
} |
| 196 |
|
|
| 197 |
|
if ($configurators = $this->getChildren($service, 'configurator')) { |
| 198 |
|
$configurator = $configurators[0]; |
| 199 |
|
if ($function = $configurator->getAttribute('function')) { |
| 200 |
|
$definition->setConfigurator($function); |
| 201 |
|
} else { |
| 202 |
|
$configuratorService = $this->getChildren($configurator, 'service'); |
| 203 |
|
|
| 204 |
|
if (isset($configuratorService[0])) { |
| 205 |
|
$class = $this->parseDefinition($configuratorService[0], $file); |
| 206 |
|
} elseif ($childService = $configurator->getAttribute('service')) { |
| 207 |
|
$class = new Reference($childService, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE, false); |
| 208 |
|
} else { |
| 209 |
|
$class = $configurator->getAttribute('class'); |
| 210 |
|
} |
| 211 |
|
|
| 212 |
|
$definition->setConfigurator(array($class, $configurator->getAttribute('method'))); |
| 213 |
|
} |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
foreach ($this->getChildren($service, 'call') as $call) { |
| 217 |
|
$definition->addMethodCall($call->getAttribute('method'), $this->getArgumentsAsPhp($call, 'argument')); |