EventDetails   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 2
Metric Value
eloc 15
c 3
b 0
f 2
dl 0
loc 24
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 16 1
1
<?php
2
3
namespace Innoflash\Events\Http\Resources;
4
5
use Carbon\Carbon;
6
use FaithGen\SDK\Helpers\ImageHelper;
7
use Illuminate\Http\Resources\Json\JsonResource;
8
use InnoFlash\LaraStart\Helper;
9
10
class EventDetails extends JsonResource
11
{
12
    /**
13
     * Transform the resource into an array.
14
     *
15
     * @param \Illuminate\Http\Request $request
16
     * @return array
17
     */
18
    public function toArray($request)
19
    {
20
        return [
21
            'id' => $this->id,
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
22
            'name' => $this->name,
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
23
            'location' => $this->location,
0 ignored issues
show
Bug Best Practice introduced by
The property location does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
24
            'published' => $this->published,
0 ignored issues
show
Bug Best Practice introduced by
The property published does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
25
            'description' => $this->description,
0 ignored issues
show
Bug Best Practice introduced by
The property description does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
26
            'url' => $this->url,
0 ignored issues
show
Bug Best Practice introduced by
The property url does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
27
            'video_url' => $this->video_url,
0 ignored issues
show
Bug Best Practice introduced by
The property video_url does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
28
            'start' => Helper::getDates($this->start),
0 ignored issues
show
Bug Best Practice introduced by
The property start does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
29
            'end' => Helper::getDates($this->end),
0 ignored issues
show
Bug Best Practice introduced by
The property end does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
30
            'is_past' => Carbon::parse($this->end)->isPast(),
31
            'date' => Carbon::parse($this->start)->format('Y/m/d'),
32
            'avatar' => ImageHelper::getImage('events', $this->image, config('faithgen-sdk.ministries-server')),
0 ignored issues
show
Bug Best Practice introduced by
The property image does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
33
            'guests' => Guest::collection($this->guests),
0 ignored issues
show
Bug Best Practice introduced by
The property guests does not exist on Innoflash\Events\Http\Resources\EventDetails. Since you implemented __get, consider adding a @property annotation.
Loading history...
34
        ];
35
    }
36
}
37