Passed
Push — main ( 93a56b...1863f6 )
by Tan
11:12
created

TagResource::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 5
c 1
b 1
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace CSlant\Blog\Api\Http\Resources;
4
5
use CSlant\Blog\Core\Models\Tag;
6
use Illuminate\Http\Resources\Json\JsonResource;
7
8
/**
9
 * @mixin Tag
10
 */
11
class TagResource extends JsonResource
12
{
13
    /**
14
     * @param $request
15
     *
16
     * @return array<string, mixed>
17
     */
18
    public function toArray($request): array
19
    {
20
        /** @var Tag $this */
21
        return [
22
            'id' => $this->id,
23
            'name' => $this->name,
24
            'slug' => $this->slug,
25
            'description' => $this->description,
26
        ];
27
    }
28
}
29