Passed
Push — main ( a422fb...18c4ea )
by Tan
03:26
created

MetaBoxResource::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 5
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 8
rs 10
1
<?php
2
3
namespace CSlant\Blog\Api\Http\Resources\MetaBox;
4
5
use CSlant\Blog\Core\Models\MetaBox;
6
use Illuminate\Http\Request;
7
use Illuminate\Http\Resources\Json\JsonResource;
8
9
/**
10
 * @mixin MetaBox
11
 */
12
class MetaBoxResource extends JsonResource
13
{
14
    /**
15
     * @param  Request  $request
16
     *
17
     * @return array<string, mixed>
18
     */
19
    public function toArray(Request $request): array
20
    {
21
        /** @var MetaBox $this */
22
        return [
23
            'meta_key' => $this->meta_key,
24
            'meta_value' => $this->meta_value,
25
            'reference_id' => $this->reference_id,
26
            'reference_type' => $this->reference_type,
27
        ];
28
    }
29
}
30