Passed
Push — main ( 2e9e01...1bac82 )
by PRATIK
15:02
created

VideoResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
dl 0
loc 16
rs 10
c 1
b 0
f 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 8 1
1
<?php
2
3
namespace Adminetic\Website\Http\Resources\Video;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
7
class VideoResource extends JsonResource
8
{
9
    /**
10
     * Transform the resource into an array.
11
     *
12
     * @param  \Illuminate\Http\Request  $request
13
     * @return array
14
     */
15
    public function toArray($request)
16
    {
17
        return [
18
            'type' => 'videos',
19
            'id' => (string) $this->id,
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on Adminetic\Website\Http\R...ces\Video\VideoResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
20
            'attributes' => parent::toArray($request),
21
            'links' => [
22
                'self' => adminShowRoute('video', $this->id)
0 ignored issues
show
Bug introduced by
The function adminShowRoute was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
                'self' => /** @scrutinizer ignore-call */ adminShowRoute('video', $this->id)
Loading history...
23
            ]
24
        ];
25
    }
26
}
27