I\'m writing an open source application uses some Symfony components, and using Symfony Console component for interacting with shell.
But, i need to inject dependen
It is best not to inject the container itself but to inject services from the container into your object. If you're using Symfony2's container, then you can do something like this:
MyBundle/Resources/config/services (or wherever you decide to put this file):
...
...
Then your command class should look like this:
someService = $someService;
}
...
I know you said you're not using the dependency injection container, but in order to implement the above answer from @ramon, you have to use it. At least this way your command can be properly unit tested.