Permalink
Please sign in to comment.
Showing
with
89 additions
and 2 deletions.
- +6 −0 bootstrap.php
- +34 −2 src/Controller/Event.php
- +23 −0 src/Model/Event.php
- +26 −0 src/Serializer/Event.php
@@ -0,0 +1,26 @@ | |||
<?php | |||
namespace Jacobemerick\LifestreamService\Serializer; | |||
use DateTime; | |||
class Event | |||
{ | |||
/** | |||
* @param array $event | |||
* @return array | |||
*/ | |||
public function __invoke(array $event) | |||
{ | |||
return [ | |||
'id' => $event['id'], | |||
'description' => $event['description'], | |||
'description_html' => $event['description_html'], | |||
'metadata' => json_decode($event['metadata'], true), | |||
'date' => (new DateTime($event['date']))->format('c'), | |||
'user' => $event['user_name'], | |||
'type' => $event['type_name'], | |||
]; | |||
} | |||
} |
0 comments on commit
e951c4e