Skip to content

Conversation

Nek-
Copy link
Contributor

@Nek- Nek- commented Jun 1, 2018

Calling parent constructor after doing stuff in the overrided constructor is a bad habit. The documentation should encourage good practices.

Calling parent constructor after doing stuff in the overrided
constructor is a bad habit.
Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is a better practice. Thanks!

@yceruto
Copy link
Member

yceruto commented Jun 1, 2018

In general Yes! but I guess it was on purpose for this case, because console commands call to configure() method at the end of the constructor, so any argument used there, is already setted, avoiding issues like this symfony/symfony#27224

@Nek-
Copy link
Contributor Author

Nek- commented Jun 5, 2018

configure method should not use the given parameters to the constructor. So I guess my change is still relevant.

@javiereguiluz
Copy link
Member

I've reviewed the information and the PR linked by Yonel and I think we must explain this better in the docs. That's why I'm closing this PR in favor of #9969.

@Nek- thanks for reporting this problem and helping us improve Symfony!

javiereguiluz added a commit that referenced this pull request Jun 27, 2018
…igure (javiereguiluz)

This PR was merged into the 3.4 branch.

Discussion
----------

Explained some issues about command constructors and configure

This fixes #9863 differently.

Commits
-------

27beba5 Explained some issues about command constructors and configure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants