Created
August 9, 2022 18:30
-
-
Save mikemix/c9c1bef2cee14bd9078ad7487f98d4dd 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 | |
{ | |
$label = 'unknown'; | |
if ('complete' === $order->getStatus()) { | |
$label = 'Completed'; | |
} | |
if ('pending' === $order->getStatus()) { | |
$label = 'In transport'; | |
} | |
if ('new' === $order->getStatus()) { | |
$label = 'New'; | |
} | |
return $label'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment