Skip to content

Commit

Permalink
Fix returning possible null values
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dkreuer authored Mar 9, 2020
1 parent 6d65806 commit c3c8e50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Command/ListClientsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c3c8e50

Please sign in to comment.