Skip to content

Commit

Permalink
Compiler: added Decorator extension to $last (#197)
Browse files Browse the repository at this point in the history
Decorator extension needs to be resolved last (eg. after Search extension) in order to find all possible matching services.

Solves my issue where decorator doesn't decorate services found using Search extension.
  • Loading branch information
peldax authored and dg committed Aug 19, 2019
1 parent 35bb65e commit a75737b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DI/Compiler.php
Expand Up @@ -219,7 +219,7 @@ public function processExtensions(): void
$extension->loadConfiguration();
}

$last = $this->getExtensions(Extensions\InjectExtension::class);
$last = $this->getExtensions(Extensions\DecoratorExtension::class) + $this->getExtensions(Extensions\InjectExtension::class);
$this->extensions = array_merge(array_diff_key($this->extensions, $last), $last);

$extensions = array_diff_key($this->extensions, $first, [self::SERVICES => 1]);
Expand Down

0 comments on commit a75737b

Please sign in to comment.