Completed
Push — develop ( e8c6bf...b28c51 )
by Abdelrahman
02:53
created

AbilityTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Auth\Transformers\Adminarea;
6
7
use Cortex\Auth\Models\Ability;
8
use League\Fractal\TransformerAbstract;
9
10
class AbilityTransformer extends TransformerAbstract
11
{
12
    /**
13
     * @return array
14
     */
15
    public function transform(Ability $ability): array
16
    {
17
        return [
18
            'id' => (string) $ability->getRouteKey(),
19
            'title' => (string) $ability->title,
20
            'name' => (string) $ability->name,
21
            'created_at' => (string) $ability->created_at,
22
            'updated_at' => (string) $ability->updated_at,
23
        ];
24
    }
25
}
26