8000 Fix wrong place of parent constructor call by Nek- · Pull Request #9863 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Fix wrong place of parent constructor call #9863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

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
0