|
@@ 179-192 (lines=14) @@
|
| 176 |
|
|
| 177 |
|
$this->addMethodCalls($definition->getMethodCalls(), $service); |
| 178 |
|
|
| 179 |
|
if ($callable = $definition->getFactory()) { |
| 180 |
|
$factory = $this->document->createElement('factory'); |
| 181 |
|
|
| 182 |
|
if (is_array($callable) && $callable[0] instanceof Definition) { |
| 183 |
|
$this->addService($callable[0], null, $factory); |
| 184 |
|
$factory->setAttribute('method', $callable[1]); |
| 185 |
|
} elseif (is_array($callable)) { |
| 186 |
|
$factory->setAttribute($callable[0] instanceof Reference ? 'service' : 'class', $callable[0]); |
| 187 |
|
$factory->setAttribute('method', $callable[1]); |
| 188 |
|
} else { |
| 189 |
|
$factory->setAttribute('function', $callable); |
| 190 |
|
} |
| 191 |
|
$service->appendChild($factory); |
| 192 |
|
} |
| 193 |
|
|
| 194 |
|
if ($callable = $definition->getConfigurator()) { |
| 195 |
|
$configurator = $this->document->createElement('configurator'); |
|
@@ 194-207 (lines=14) @@
|
| 191 |
|
$service->appendChild($factory); |
| 192 |
|
} |
| 193 |
|
|
| 194 |
|
if ($callable = $definition->getConfigurator()) { |
| 195 |
|
$configurator = $this->document->createElement('configurator'); |
| 196 |
|
|
| 197 |
|
if (is_array($callable) && $callable[0] instanceof Definition) { |
| 198 |
|
$this->addService($callable[0], null, $configurator); |
| 199 |
|
$configurator->setAttribute('method', $callable[1]); |
| 200 |
|
} elseif (is_array($callable)) { |
| 201 |
|
$configurator->setAttribute($callable[0] instanceof Reference ? 'service' : 'class', $callable[0]); |
| 202 |
|
$configurator->setAttribute('method', $callable[1]); |
| 203 |
|
} else { |
| 204 |
|
$configurator->setAttribute('function', $callable); |
| 205 |
|
} |
| 206 |
|
$service->appendChild($configurator); |
| 207 |
|
} |
| 208 |
|
|
| 209 |
|
$parent->appendChild($service); |
| 210 |
|
} |