symfony/symfony — pull request #8118 by zakharovvi (2013-05-22 18:54:29+00:00)
Title: [Console] add exceptions for incorrect Command inheritance

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | possibly
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Hello,

I use console commands with constructor dependency injection. I overrided Command constructor and forgot call parent::__construct(). When I ran app/console, I saw:

Warning: Invalid argument supplied for foreach() in /vendor_dir/symfony/console/Symfony/Component/Console/Application.php on line 411

I added $this->setAliases(array()) to constructor. After that warning disappeared, but I not found my new command in available commands, because configure method not called in my new constructor.

This PR simplify debugging this situation.