Skip to content

Command::execute() should always return int - deprecate returning null #33747

Closed
@nicolas-grekas

Description

@nicolas-grekas

Right now, Command::execute() returns int|void.

I'd suggest we should deprecate returning void (or null) by throwing a deprecation when the method returns a non-int, in Application.

We would need to update all core commands to return 0; where they return; right now.

And in 5.0, we would make returning a non-int throw an exception, in preparation for adding a real return type in 6.0.

Help wanted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConsoleDeprecationHelp wantedIssues and PRs which are looking for volunteers to complete them.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions