Completed
Push — master ( 49faca...44018c )
by David Martínez
05:46
created

LessonTransformer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0
ccs 0
cts 8
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 11 1
1
<?php
2
3
namespace Scool\Timetables\Transformers;
4
5
use League\Fractal\TransformerAbstract;
6
use Scool\Timetables\Models\Lesson;
7
8
/**
9
 * Class LessonTransformer
10
 * @package namespace Scool\Timetables\Transformers;
11
 */
12
class LessonTransformer extends TransformerAbstract
13
{
14
15
    /**
16
     * Transform the \Lesson entity
17
     * @param \Lesson $model
18
     *
19
     * @return array
20
     */
21
    public function transform(Lesson $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