| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 6 | public function toArray($request) |
|
| 17 | { |
||
| 18 | 6 | $collection = $this->collection; |
|
| 19 | 6 | foreach($collection as $item) |
|
| 20 | { |
||
| 21 | 6 | if($item['expire'] < Carbon::now()) |
|
| 22 | { |
||
| 23 | $item['expired'] = 1; |
||
| 24 | } |
||
| 25 | else |
||
| 26 | { |
||
| 27 | 6 | $item['expired'] = 0; |
|
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 6 | return parent::toArray( |
|
| 32 | /** @scrutinizer ignore-type */ |
||
| 33 | 6 | $collection); |
|
| 34 | } |
||
| 36 |