TestimonialTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Testimonials\Transformers\Adminarea;
6
7
use Rinvex\Support\Traits\Escaper;
8
use League\Fractal\TransformerAbstract;
9
use Cortex\Testimonials\Models\Testimonial;
10
11
class TestimonialTransformer extends TransformerAbstract
12
{
13
    use Escaper;
14
15
    /**
16
     * @return array
17
     */
18
    public function transform(Testimonial $testimonial): array
19
    {
20
        return $this->escape([
21
            'id' => (string) $testimonial->getRouteKey(),
22
            'created_at' => (string) $testimonial->created_at,
23
            'updated_at' => (string) $testimonial->updated_at,
24
        ]);
25
    }
26
}
27