Guest::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 2
b 0
f 1
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Innoflash\Events\Http\Resources;
4
5
use FaithGen\SDK\Helpers\ImageHelper;
6
use Illuminate\Http\Resources\Json\JsonResource;
7
8
class Guest extends JsonResource
9
{
10
    /**
11
     * Transform the resource into an array.
12
     *
13
     * @param \Illuminate\Http\Request $request
14
     * @return array
15
     */
16
    public function toArray($request)
17
    {
18
        return array_merge(parent::toArray($request), [
19
            '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\Guest. Since you implemented __get, consider adding a @property annotation.
Loading history...
20
        ]);
21
    }
22
}
23