Permalink
Browse files

DIExtension: tag 'run' is deprecated (BC break)

  • Loading branch information...
dg committed Feb 5, 2019
1 parent 34c57c9 commit 7b30687bfd3e9b3bf97088537a9d35e878d07bbf
Showing with 2 additions and 1 deletion.
  1. +1 −0 src/DI/Extensions/DIExtension.php
  2. +1 −1 tests/DI/DIExtension.run.phpt
@@ -62,6 +62,7 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class)
}
foreach (array_filter($builder->findByTag('run')) as $name => $on) {
trigger_error("Tag 'run' used in service '$name' definition is deprecated.", E_USER_DEPRECATED);
$initialize->addBody('$this->getService(?);', [$name]);
}
}
@@ -23,7 +23,7 @@ services:
- {factory: stdClass, tags: [run]}
', 'neon'));
eval($compiler->addConfig($config)->setClassName('Container1')->compile());
@eval($compiler->addConfig($config)->setClassName('Container1')->compile()); // @ tag is deprecated
$container = new Container1;
Assert::false($container->isCreated('std'));

0 comments on commit 7b30687

Please sign in to comment.