| Conditions | 4 |
| Paths | 8 |
| Total Lines | 15 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 8 | public function toArray($request) |
|
| 18 | { |
||
| 19 | return [ |
||
| 20 | 8 | 'link_id' => $this->link_id, |
|
| 21 | 8 | 'user_id' => $this->user_id, |
|
| 22 | 8 | 'cust_id' => $this->cust_id, |
|
| 23 | 8 | 'cust_name' => $this->cust_id ? Cust::find($this->cust_id)->name : 'None', |
|
| 24 | 8 | 'link_hash' => $this->link_hash, |
|
| 25 | 8 | 'link_name' => $this->link_name, |
|
| 26 | 8 | 'exp_format' => Carbon::parse($this->expire)->format('M d, Y'), |
|
| 27 | 8 | 'expired' => $this->expire < Carbon::now() ? 1 : 0, |
|
| 28 | 8 | 'exp_stamp' => Carbon::parse($this->expire)->format('Y-m-d'), |
|
| 29 | 8 | 'allow_upload' => $this->allow_upload, |
|
| 30 | 8 | 'file_count' => isset($this->file_link_files_count) ? $this->file_link_files_count : 0, |
|
| 31 | 8 | 'note' => $this->note |
|
| 32 | ]; |
||
| 35 |