|
@@ 282-293 (lines=12) @@
|
| 279 |
|
$xpath->registerNamespace('container', self::NS); |
| 280 |
|
|
| 281 |
|
// anonymous services as arguments/properties |
| 282 |
|
if (false !== $nodes = $xpath->query('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) { |
| 283 |
|
foreach ($nodes as $node) { |
| 284 |
|
// give it a unique name |
| 285 |
|
$id = sprintf('%s_%d', hash('sha256', $file), ++$count); |
| 286 |
|
$node->setAttribute('id', $id); |
| 287 |
|
|
| 288 |
|
if ($services = $this->getChildren($node, 'service')) { |
| 289 |
|
$definitions[$id] = array($services[0], $file, false); |
| 290 |
|
$services[0]->setAttribute('id', $id); |
| 291 |
|
} |
| 292 |
|
} |
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
// anonymous services "in the wild" |
| 296 |
|
if (false !== $nodes = $xpath->query('//container:services/container:service[not(@id)]')) { |
|
@@ 296-307 (lines=12) @@
|
| 293 |
|
} |
| 294 |
|
|
| 295 |
|
// anonymous services "in the wild" |
| 296 |
|
if (false !== $nodes = $xpath->query('//container:services/container:service[not(@id)]')) { |
| 297 |
|
foreach ($nodes as $node) { |
| 298 |
|
// give it a unique name |
| 299 |
|
$id = sprintf('%s_%d', hash('sha256', $file), ++$count); |
| 300 |
|
$node->setAttribute('id', $id); |
| 301 |
|
|
| 302 |
|
if ($services = $this->getChildren($node, 'service')) { |
| 303 |
|
$definitions[$id] = array($node, $file, true); |
| 304 |
|
$services[0]->setAttribute('id', $id); |
| 305 |
|
} |
| 306 |
|
} |
| 307 |
|
} |
| 308 |
|
|
| 309 |
|
// resolve definitions |
| 310 |
|
krsort($definitions); |