Passed
Push — main ( c7a6ed...5bba20 )
by Tan
05:19
created

CategoryResource::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace CSlant\Blog\Api\Http\Resources;
4
5
use Botble\Blog\Models\Category;
0 ignored issues
show
Bug introduced by
The type Botble\Blog\Models\Category was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Http\Resources\Json\JsonResource;
7
8
/**
9
 * @mixin Category
10
 */
11
class CategoryResource extends JsonResource
12
{
13
    /**  */
14
    public function toArray($request): array
15
    {
16
        /** @var Category $this */
17
        return [
18
            'id' => $this->id,
19
            'name' => $this->name,
20
            'slug' => $this->slug,
21
            'url' => $this->url,
22
            'description' => $this->description,
23
        ];
24
    }
25
}
26