Skip to content

Commit a81fc03

Browse files
committed
minor symfony#21354 [DependencyInjection] XML: optimize defaults parsing (dunglas)
This PR was merged into the 3.3-dev branch. Discussion ---------- [DependencyInjection] XML: optimize defaults parsing | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Defaults can be parsed only 1 time. Commits ------- dc115ab [DependencyInjection] XML: optimize defaults parsing
2 parents 63b8d31 + dc115ab commit a81fc03

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ private function parseDefinitions(\DOMDocument $xml, $file)
125125
return;
126126
}
127127

128+
$defaults = $this->getServiceDefaults($xml, $file);
128129
foreach ($services as $service) {
129-
if (null !== $definition = $this->parseDefinition($service, $file, $this->getServiceDefaults($xml, $file))) {
130+
if (null !== $definition = $this->parseDefinition($service, $file, $defaults)) {
130131
$this->container->setDefinition((string) $service->getAttribute('id'), $definition);
131132
}
132133
}

0 commit comments

Comments
 (0)