FAQ   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 7 1
1
<?php
2
3
namespace Faithgen\Miscellaneous\Http\Resources;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
use InnoFlash\LaraStart\Helper;
0 ignored issues
show
Bug introduced by
The type InnoFlash\LaraStart\Helper 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...
7
8
class FAQ extends JsonResource
9
{
10
    /**
11
     * Transform the resource into an array.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     *
15
     * @return array
16
     */
17
    public function toArray($request)
18
    {
19
        return [
20
            'id'       => $this->id,
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on Faithgen\Miscellaneous\Http\Resources\FAQ. Since you implemented __get, consider adding a @property annotation.
Loading history...
21
            'question' => $this->question,
0 ignored issues
show
Bug Best Practice introduced by
The property question does not exist on Faithgen\Miscellaneous\Http\Resources\FAQ. Since you implemented __get, consider adding a @property annotation.
Loading history...
22
            'answer'   => $this->answer,
0 ignored issues
show
Bug Best Practice introduced by
The property answer does not exist on Faithgen\Miscellaneous\Http\Resources\FAQ. Since you implemented __get, consider adding a @property annotation.
Loading history...
23
            'date'     => Helper::getDates($this->created_at),
0 ignored issues
show
Bug Best Practice introduced by
The property created_at does not exist on Faithgen\Miscellaneous\Http\Resources\FAQ. Since you implemented __get, consider adding a @property annotation.
Loading history...
24
        ];
25
    }
26
}
27