symfony/symfony-docs — pull request #3621 by gnugat (2014-03-01 11:56:27+00:00)
Title: [Console] Command as service

| Q | A
| ------------- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | 2.4+
| Fixed tickets | N/A

Command as a service can be useful to give access to services and
configuration parameters in the `configure` method.

A simple use case: you want to allow the user to set an option's default
value in the `app/config/parameters.yml` file. Or the default value
needs to be computed by a service (database retrieval for instance).

With a `ContainerAwareCommand`, this wouldn't be possible because the
`configure` method is called from the constructor, so the container
isn't set yet.

Original PR: #3620