Created
August 9, 2022 18:32
-
-
Save mikemix/027257503bf35d79a7d67146b7fed0c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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