Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2022 18:32
What would you like to do?
function mapOrderStatusToLabel(Order $order): string
switch ($order->getStatus()) {
case 'complete':
return 'Completed';
case 'pending':
case 'in_transport':
return 'In transport';
case 'new':
return 'New';
return 'unknown';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment