Closed TomasVotruba closed 9 years ago
Good job! Thank you. ;)
What should be added as well: (based on discussion on twitter https://twitter.com/VotrubaT/status/514332895964844032) 1) Autowire option (at the moment I exactly don't know sense of this? why does it solve the Modules lib? 2) Definitely IDecoratorProvider.
1) In Nette\DI master there was recently added DecoratorExtension.
What it does? It process services implementing certain interface or extending certain class. So you don't have to tag all router services and spam your
config.neon
.This PR enables this package compatibility with DecoratorExtension:
So now I just add
implement IRouterFactory
to router service and add my services toconfig.neon
. Interface also enforces factory method name, which is good practice and prevents errors :+1:Before this PR, you'd have to do it like this:
Which really sucks. Also you'd have to google/remember the exact string of the tag.
2) I also moved creating services to
beforeCompile
method, where all tag processing belongs (e.g. Kdyby\Events, Zenify\DoctrineFilters etc.).