Completed
Push — develop ( 884105...0f253a )
by Abdelrahman
02:05
created

PageTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 21
rs 10
c 1
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 League\Fractal\TransformerAbstract;
9
10
class PageTransformer extends TransformerAbstract
11
{
12
    /**
13
     * @return array
14
     */
15
    public function transform(Page $page): array
16
    {
17
        return [
18
            'id' => (string) $page->getRouteKey(),
19
            'title' => (string) $page->title,
20
            'uri' => (string) $page->uri,
21
            'domain' => (string) $page->domain,
22
            'route' => (string) $page->route,
23
            'view' => (string) $page->view,
24
            'middleware' => (string) $page->middleware,
25
            'sort_order' => (string) $page->sort_order,
26
            'created_at' => (string) $page->created_at,
27
            'updated_at' => (string) $page->updated_at,
28
        ];
29
    }
30
}
31