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 7, 2019
1 parent 4aff517 commit 5700203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DI/Compiler.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function processExtensions(): void
$extension->loadConfiguration(); $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); $this->extensions = array_merge(array_diff_key($this->extensions, $last), $last);


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

0 comments on commit 5700203

Please sign in to comment.