8000 [DI] Fix autowire error for inlined services by weaverryan · Pull Request #22857 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] Fix autowire error for inlined services #22857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Freeing up some memory references
  • Loading branch information
weaverryan committed May 22, 2017
commit aeb38f642a73e37635c91b73d49c682e1173def6
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,19 @@ public function __construct(AutowirePass $autowirePass, InlineServiceDefinitions

public function process(ContainerBuilder $container)
{
// the pass should only be run once
if (null === $this->autowirePass || null === $this->inlineServicePass) {
return;
}

$inlinedIds = $this->inlineServicePass->getInlinedServiceIds();
foreach ($this->autowirePass->getAutowiringExceptions() as $exception) {
$exceptions = $this->autowirePass->getAutowiringExceptions();

// free up references
$this->autowirePass = null;
$this->inlineServicePass = null;

foreach ($exceptions as $exception) {
if ($container->hasDefinition($exception->getServiceId()) || in_array($exception->getServiceId(), $inlinedIds)) {
throw $exception;
} 979D
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

Expand Down
0