Skip to content

Instantly share code, notes, and snippets.

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