Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AutowireMethodsExtension extends Nette\Config\CompilerExtension
- {
- public function beforeCompile()
- {
- $container = $this->getContainerBuilder();
- foreach ($container->getDefinitions() as $def) {
- if ($def->class) { // musis jeste pocitat s %%, takze prohnat pres expand()
- $refl = Nette\Reflection\ClassType::from($class);
- foreach ($refl->getMethods() as $method) {
- if (substr($method->getName(), 0, 6) === 'inject') {
- $def->addSetup($method->getName(), array('...'));
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment