LessonTransformer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 18 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
//            'user_id'           => (int) $model->user_id,
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
26
//            'day_id'            => (int) $model->day_id,
27
//            'timeslot_id'       => (int) $model->timeslot_id ,
28
//            'date'              => $model->date,
29
//            'studysubmodule_id' => (int) $model->studysubmodule_id ,
30
//            'type_id'           => (int) $model->type_id,
31
//            'notes'             => $model->notes,
32
33
            /* place your other model properties here */
34
35
            'created_at' => $model->created_at,
36
            'updated_at' => $model->updated_at
37
        ];
38
    }
39
}
40