starpeace-project /
starpeace-lumen-api-interface
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Http\Resources; |
||
| 4 | |||
| 5 | use Illuminate\Http\Resources\Json\JsonResource; |
||
| 6 | |||
| 7 | class WorldResource extends JsonResource |
||
| 8 | { |
||
| 9 | public function toArray($request) |
||
| 10 | { |
||
| 11 | $data = [ |
||
| 12 | 'id' => $this->id, |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 13 | 'map_id' => $this->map_id, |
||
|
0 ignored issues
–
show
The property
map_id does not exist on App\Http\Resources\WorldResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 14 | 'display_name' => $this->display_name, |
||
|
0 ignored issues
–
show
The property
display_name does not exist on App\Http\Resources\WorldResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 15 | 'year' => $this->year, |
||
|
0 ignored issues
–
show
The property
year does not exist on App\Http\Resources\WorldResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 16 | ]; |
||
| 17 | |||
| 18 | if ($this->investors_count !== null) { |
||
|
0 ignored issues
–
show
The property
investors_count does not exist on App\Http\Resources\WorldResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 19 | $data['investors'] = $this->investors_count; |
||
| 20 | } |
||
| 21 | |||
| 22 | if ($this->online_count !== null) { |
||
|
0 ignored issues
–
show
The property
online_count does not exist on App\Http\Resources\WorldResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 23 | $data['online'] = $this->online_count; |
||
| 24 | } |
||
| 25 | |||
| 26 | if ($this->updated_at !== null) { |
||
|
0 ignored issues
–
show
The property
updated_at does not exist on App\Http\Resources\WorldResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||
| 27 | $data['updated_at'] = $this->updated_at->format('Y-m-d H:i:s'); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $data; |
||
| 31 | } |
||
| 32 | } |