From 47f2e6b16f979e5844a3e714c3a3488b08261053 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Mon, 19 Sep 2022 08:10:58 -0400 Subject: [PATCH] Fix #5224. config:export --help includes warning about 'Undefined array key description' --- src/Commands/help/HelpCLIFormatter.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Commands/help/HelpCLIFormatter.php b/src/Commands/help/HelpCLIFormatter.php index 3c63fc1e92..f54fcbc890 100644 --- a/src/Commands/help/HelpCLIFormatter.php +++ b/src/Commands/help/HelpCLIFormatter.php @@ -136,11 +136,18 @@ public static function formatArgumentName($argument) protected function cleanOptions(&$data): void { + if (array_key_exists('options', $data)) { foreach ($data['options'] as $key => $option) { + // Remove global options. if (self::isGlobalOption($key)) { unset($data['options'][$key]); } + + // Populate missing props. + if ($key == 'desciption' && !isset($option[$key])) { + $option[$key] = ''; + } } } }