From c3c8e50b6a1ac8f2b311f49166ebddb96cc829f9 Mon Sep 17 00:00:00 2001 From: Daniel Kreuer Date: Mon, 9 Mar 2020 23:58:18 +0100 Subject: [PATCH] Fix returning possible null values The function may return null values but the return type annotation restricts to return strings only. This workaround prevents PHP from crashing by returning an empty string instead - which is fine because the result is sent to output. --- Command/ListClientsCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Command/ListClientsCommand.php b/Command/ListClientsCommand.php index 2cbcdc66..06f79b62 100644 --- a/Command/ListClientsCommand.php +++ b/Command/ListClientsCommand.php @@ -115,7 +115,7 @@ private function getRows(array $clients, array $columns): array ]; return array_map(static function (string $column) use ($values): string { - return $values[$column]; + return $values[$column] ?? ''; }, $columns); }, $clients); }