Skip to content

Missing guideline when explaining how to get services from the service container in a Command #8841

Closed
@netsuo

Description

@netsuo

In the current documentation, in the paragraph where it explains how to inject services in a command, the documentation doesn't state that you should call parent::__construct.

https://symfony.com/doc/current/console.html#getting-services-from-the-service-container

However, it is explained in the documentation about defining Commands as services.

https://symfony.com/doc/current/console/commands_as_services.html

I think we should add this information in the first link to avoid user having unusable Commands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsoleactionableClear and specific issues ready for anyone to take them.hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions