Passed
Pull Request — main (#25)
by Seth
03:52 queued 01:14
created

ReleaseNoteResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 8 1
1
<?php
2
3
namespace SaasReady\Http\Responses;
4
5
use Illuminate\Http\Resources\Json\JsonResource;
6
use SaasReady\Models\ReleaseNote;
7
8
/**
9
 * @mixin ReleaseNote
10
 */
11
class ReleaseNoteResource extends JsonResource
12
{
13
    public function toArray($request): array
14
    {
15
        return [
16
            'uuid' => $this->uuid,
0 ignored issues
show
Bug Best Practice introduced by
The property uuid does not exist on SaasReady\Http\Responses\ReleaseNoteResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
17
            'version' => $this->version,
0 ignored issues
show
Bug Best Practice introduced by
The property version does not exist on SaasReady\Http\Responses\ReleaseNoteResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
18
            'note' => $this->note,
0 ignored issues
show
Bug Best Practice introduced by
The property note does not exist on SaasReady\Http\Responses\ReleaseNoteResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
19
            'created_at' => $this->created_at?->toDateTimeString(),
0 ignored issues
show
Bug Best Practice introduced by
The property created_at does not exist on SaasReady\Http\Responses\ReleaseNoteResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
20
            'updated_at' => $this->updated_at?->toDateTimeString(),
0 ignored issues
show
Bug Best Practice introduced by
The property updated_at does not exist on SaasReady\Http\Responses\ReleaseNoteResource. Since you implemented __get, consider adding a @property annotation.
Loading history...
21
        ];
22
    }
23
}
24