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 Jul 8, 2019
1 parent a33f893 commit 1010cee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DI/Compiler.php
Expand Up @@ -216,7 +216,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 1010cee

Please sign in to comment.