Skip to content

Commit a331f7d

Browse files
[FrameworkBundle] Add & use Psr6CacheClearer
1 parent 22e9349 commit a331f7d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Compiler/PassConfig.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ public function __construct()
5858

5959
$this->removingPasses = array(
6060
new RemovePrivateAliasesPass(),
61-
new RemoveAbstractDefinitionsPass(),
6261
new ReplaceAliasByActualDefinitionPass(),
62+
new RemoveAbstractDefinitionsPass(),
6363
new RepeatedPass(array(
6464
new AnalyzeServiceReferencesPass(),
6565
new InlineServiceDefinitionsPass(),
@@ -102,8 +102,7 @@ public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_O
102102
throw new InvalidArgumentException(sprintf('Invalid type "%s".', $type));
103103
}
104104

105-
$passes = &$this->$property;
106-
$passes[] = $pass;
105+
$this->{$property}[] = $pass;
107106
}
108107

109108
/**

Compiler/ResolveDefinitionTemplatesPass.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\DependencyInjection\DefinitionDecorator;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
18+
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1819

1920
/**
2021
* This replaces all DefinitionDecorator instances with their equivalent fully
@@ -96,11 +97,12 @@ private function resolveArguments(ContainerBuilder $container, array $arguments,
9697
*/
9798
private function resolveDefinition(ContainerBuilder $container, DefinitionDecorator $definition)
9899
{
99-
if (!$container->hasDefinition($parent = $definition->getParent())) {
100+
try {
101+
$parentDef = $container->findDefinition($parent = $definition->getParent());
102+
} catch (ServiceNotFoundException $e) {
100103
throw new RuntimeException(sprintf('The parent definition "%s" defined for definition "%s" does not exist.', $parent, $this->currentId));
101104
}
102105

103-
$parentDef = $container->getDefinition($parent);
104106
if ($parentDef instanceof DefinitionDecorator) {
105107
$id = $this->currentId;
106108
$this->currentId = $parent;

0 commit comments

Comments
 (0)