CountryResource   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 10 1
1
<?php
2
3
namespace SaasReady\Http\Responses;
4
5
use Illuminate\Http\Request;
0 ignored issues
show
Bug introduced by
The type Illuminate\Http\Request 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;
0 ignored issues
show
Bug introduced by
The type Illuminate\Http\Resources\Json\JsonResource 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
use SaasReady\Models\Country;
0 ignored issues
show
Bug introduced by
The type SaasReady\Models\Country 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...
8
9
/**
10
 * @mixin Country
11
 */
12
class CountryResource extends JsonResource
13
{
14
    public function toArray($request): array
15
    {
16
        return [
17
            'uuid' => $this->uuid,
18
            'code' => $this->code,
19
            'name' => $this->name,
20
            'continent' => $this->continent,
21
            'dial_code' => $this->dial_code,
22
            'created_at' => $this->created_at?->toDateTimeString(),
23
            'updated_at' => $this->updated_at?->toDateTimeString(),
24
        ];
25
    }
26
}
27