CurrencyResource   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 13
dl 0
loc 16
rs 10
c 1
b 0
f 0
wmc 1

1 Method

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