Open MakerTim opened 1 week ago
It's a warning not an error or a crash. I'm ambivalent about making description optional.
Also ambivalent. Description should be required, but Drush should behave well if it isn't provided. We could emit a warning when the command is declared, and skip adding it to the application object. Not sure if we should be that strict.
Sorry, but it does crash.
Yes: first you run into a [warning] Undefined array key "description" HelpCLIFormatter.php:29
But after that it will call writeln
with null -> that does crash
Argument #1 ($messages) must be of type Traversable|array|string, null given
I get that it's better to enforce a description, but crashing is not the way to do so if you ask me.
Maybe an assert
-> then development is affected but it wont on production
Describe the bug Tried to use --help on a few commands, but get an error about null and description
To Reproduce There are many drush commands out there that have this behaviour. proof of concept code:
Expected behavior An help "page" about the given command.
Workaround Currently working with the following patch: What adds a default to description: now it is a empty line but its better than a crash.
System Configuration
Additional information