Skip to content

Commit

Permalink
ApplicationExtension: presenters are not autowired
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 10, 2019
1 parent 4972933 commit e402814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Bridges/ApplicationDI/ApplicationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public function beforeCompile()
}

foreach ($all as $def) {
$def->addTag(Nette\DI\Extensions\InjectExtension::TAG_INJECT);
$def->addTag(Nette\DI\Extensions\InjectExtension::TAG_INJECT)
->setAutowired(false);

if (is_subclass_of($def->getType(), UI\Presenter::class)) {
$def->addSetup('$invalidLinkMode', [$this->invalidLinkMode]);
Expand Down
3 changes: 2 additions & 1 deletion tests/Bridges.DI/ApplicationExtension.scan.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ test(function () {
Assert::count(1, $container->findByType(Presenter1::class));
Assert::count(1, $container->findByType(Presenter2::class));

Assert::same('test', $container->getByType(Presenter1::class)->getView());
$name = $container->findByType(Presenter1::class)[0];
Assert::same('test', $container->createService($name)->getView());
});

0 comments on commit e402814

Please sign in to comment.