joomla-framework / console

Joomla Framework Console Package
GNU General Public License v2.0
9 stars 4 forks source link

Remove initialise function #1

Closed wilsonge closed 7 years ago

wilsonge commented 7 years ago

You can just override the constructor and call parent::__construct

mbabker commented 7 years ago

You need to fix the command subclasses if you're going to do this.

FWIW the same pattern already exists in our application class and the Symfony Command class, so it's not completely "wrong".

mbabker commented 7 years ago

Making a call here, going to leave it as is.

1) We already use this type of pattern in the application stack. 2) For dependency-less commands, there is one less thing they have to worry about (setting the InputDefinition) using this pattern versus going for extended constructors. Folks creating commands as service classes will still have to call parent::__construct() unless they inline the logic, there's no getting around that.