StudentResource::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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