| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | public function toArray($request) |
|
| 24 | { |
||
| 25 | 2 | $notification = (object)$this->data; |
|
|
|
|||
| 26 | $resource = [ |
||
| 27 | 2 | 'id' => $this->getKey(), |
|
| 28 | 2 | 'title' => $notification->title, |
|
| 29 | 2 | 'message' => $notification->message, |
|
| 30 | 2 | 'target' => $notification->target, |
|
| 31 | 2 | 'tag' => $notification->tag, |
|
| 32 | 2 | 'is_read' => isset($this->read_at) ? true : false |
|
| 33 | ]; |
||
| 34 | 2 | return $resource; |
|
| 35 | } |
||
| 37 |