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

ReleaseNoteResource::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
nc 1
nop 1
dl 0
loc 8
c 1
b 0
f 0
cc 1
rs 10
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