| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 4 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 17 | public function transform(Notification $notification) |
||
| 18 | { |
||
| 19 | return [ |
||
| 20 | 'id' => (int) $notification->id, |
||
| 21 | 'icon' => (string) $notification->icon, |
||
| 22 | 'link' => (string) $notification->link, |
||
| 23 | 'message' => (string) $notification->message, |
||
| 24 | 'dismissed' => (bool) $notification->dismissed, |
||
| 25 | 'created' => [ |
||
| 26 | 'timestamp' => $notification->created_at->getTimestamp(), |
||
| 27 | 'date' => (string) $notification->created_at->toFormattedDateString(), |
||
| 28 | 'readable' => (string) $notification->created_at->diffForHumans(), |
||
| 29 | ], |
||
| 30 | ]; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |