Closed
Description
Some use-cases require to inject an instance of Symfony\Component\Console\Application
class into arbitrary service.
Example use-case: there is a daemon based on symfony console component which can run workers. Each worker is a container service. Some workers can run arbitrary application commands inside the separated process (as an example of such a command is consuming messages). To run a command worker needs an instance of Application.
<service id="App\Worker\SomeWorker">
<argument type="service" id="Symfony\Component\Console\Application" />
</service>
<!-- or -->
<service id="App\Worker\SomeWorker">
<argument type="service" id="application" />
</service>
This feature will also reduce complexity of adding custom helper sets by defining them as services and injecting them into Application service using CompilerPass.
<service id="App\Console\HelperSet\MyHelper">
<tag name="console.helper_set" helper="my" />
</service>