StudentResource   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
1
<?php
2
3
namespace App\Http\Resources;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Http\Resources\Json\JsonResource;
7
8
final class StudentResource extends JsonResource
9
{
10
    /**
11
     * @param  Request  $request
12
     * @return array
13
     */
14
    public function toArray($request)
15
    {
16
        return [
17
            'id'   => $this->id,
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on App\Http\Resources\StudentResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
18
            'name' => $this->name,
0 ignored issues
show
Bug Best Practice introduced by
The property name does not exist on App\Http\Resources\StudentResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
19
        ];
20
    }
21
}
22