Skip to content

Instantly share code, notes, and snippets.

@dilab
Created December 26, 2015 04:39
Show Gist options
  • Save dilab/46d3b18d8030f2557a56 to your computer and use it in GitHub Desktop.
Save dilab/46d3b18d8030f2557a56 to your computer and use it in GitHub Desktop.
return array_map(function ($c, $serializedTicket) {
$ticket = unserialize($serializedTicket);
return [
'id' => $ticket->get('id'),
'name' => $ticket->get('name'),
'amt' => $this->toDollarFormat($ticket->get('price')->toCent()),
'qty' => $c
];
}, array_count_values(
array_map('serialize', $bill->getTickets())
), array_keys(array_count_values(
array_map('serialize', $bill->getTickets())
)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment