ClassroomTransformer::transform()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
ccs 0
cts 9
cp 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Scool\EnrollmentMobile\Transformers;
4
5
use League\Fractal\TransformerAbstract;
6
use Scool\EnrollmentMobile\Models\Classroom;
7
8
/**
9
 * Class ClassroomTransformer
10
 * @package namespace App\Transformers;
11
 */
12
class ClassroomTransformer extends TransformerAbstract
13
{
14
15
    /**
16
     * Transform the \Classroom entity
17
     * @param \Classroom $model
18
     *
19
     * @return array
20
     */
21
    public function transform(Classroom $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