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

GuardianTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

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