Skip to content

Instantly share code, notes, and snippets.

@mikemix
Last active August 9, 2022 18:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mikemix/03caecb77900f7e68239ced562009238 to your computer and use it in GitHub Desktop.
<?php
function mapOrderStatusToLabel(Order $order): string
{
if ($order->isComplete()) {
return 'Completed';
} elseif ($order->isPending()) {
return 'In transport';
} else {
return 'New';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment