don't inject the service_container but use an injector

In practice it wraps the access to the ServiceContainer
Merge branch 'feat-container-injector'
use a closure instead of global function in scripts/generate-events.php