PageTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Pages\Transformers\Managerarea;
6
7
use Cortex\Pages\Models\Page;
8
use Rinvex\Support\Traits\Escaper;
9
use League\Fractal\TransformerAbstract;
10
11
class PageTransformer extends TransformerAbstract
12
{
13
    use Escaper;
14
15
    /**
16
     * @return array
17
     */
18
    public function transform(Page $page): array
19
    {
20
        return $this->escape([
21
            'id' => (string) $page->getRouteKey(),
22
            'title' => (string) $page->title,
23
            'uri' => (string) $page->uri,
24
            'domain' => (string) $page->domain,
25
            'route' => (string) $page->route,
26
            'view' => (string) $page->view,
27
            'middleware' => (string) $page->middleware,
28
            'sort_order' => (string) $page->sort_order,
29
            'created_at' => (string) $page->created_at,
30
            'updated_at' => (string) $page->updated_at,
31
        ]);
32
    }
33
}
34