Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 50ad8b4

Browse filesBrowse files
committed
Making all _defaults apply, but this breaks the tests for now
1 parent 6140c90 commit 50ad8b4
Copy full SHA for 50ad8b4

File tree

1 file changed

+11
-1
lines changed
Filter options

1 file changed

+11
-1
lines changed

‎src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ private function parseDefinition($id, $service, $file, array $defaults)
357357
$definition = new ChildDefinition($service['parent']);
358358
} else {
359359
$definition = new Definition();
360+
}
360361

362+
if (!$this->isLoadingInstanceof) {
361363
if (isset($defaults['public'])) {
362364
$definition->setPublic($defaults['public']);
363365
}
@@ -368,7 +370,15 @@ private function parseDefinition($id, $service, $file, array $defaults)
368370
$definition->setAutoconfigured($defaults['autoconfigure']);
369371
}
370372

371-
$definition->setChanges(array());
373+
// don't reset changes for children, otherwise their
374+
// parent values will always win, even if they're not
375+
// explicitly set. We should be able to remove this if
376+
// the ResolveDefinitionTemplatesPass is made smarter
377+
// to only override values from the parent *if* they
378+
// are explicitly set.
379+
if (!$definition instanceof ChildDefinition) {
380+
$definition->setChanges(array());
381+
}
372382
}
373383

374384
if (isset($service['class'])) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.