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

MetaBoxResource   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 8 1
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