Completed
Push — master ( 4e34cd...643d5b )
by Manel
13:04
created

PersonTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 11 1
1
<?php
2
3
namespace Scool\EnrollmentMobile\Transformers;
4
5
use League\Fractal\TransformerAbstract;
6
use Scool\EnrollmentMobile\Entities\Person;
7
8
/**
9
 * Class PersonTransformer
10
 * @package namespace Scool\EnrollmentMobile\Transformers;
11
 */
12
class PersonTransformer extends TransformerAbstract
13
{
14
15
    /**
16
     * Transform the \Person entity
17
     * @param \Person $model
18
     *
19
     * @return array
20
     */
21
    public function transform(Person $model)
22
    {
23
        return [
24
            'id'         => (int) $model->id,
25
26
            /* place your other model properties here */
27
28
            'created_at' => $model->created_at,
29
            'updated_at' => $model->updated_at
30
        ];
31
    }
32
}
33