Skip to content

Inconsistency between condition and error message in abort() example #8266

@zigzagdev

Description

@zigzagdev

Content

In the Command documentation, there is an inconsistency between the condition and the error message in the following example:

if (strlen($name) < 5) {
    $io->error('Name must be at least 4 characters long.');
    $this->abort();
}

The condition strlen($name) < 5 requires the name to be at least 5 characters, but the error message says "at least 4 characters long."

The same inconsistency exists in the second example using $io->abort():

if (strlen($name) < 5) {
    $io->abort('名前は4文字以上にする必要があります。', 99);
}

Could you clarify which is intended — should the minimum length be 4 or 5 characters?
Once confirmed, I'd be happy to submit a PR to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions