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

TagResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 8 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