1 | <?php |
||
21 | class Enrollment extends Model implements Transformable |
||
22 | { |
||
23 | use TransformableTrait,Nameable, RecordsActivity; // StatefulTrait; |
||
24 | |||
25 | |||
26 | protected $fillable = ['id','name','validated','finished', 'user_id', 'study_id','course_id','classroom_id']; |
||
27 | |||
28 | protected $states = [ |
||
29 | 'User' => ['initial' => true], |
||
30 | 'Enrollments', |
||
31 | 'Study', |
||
32 | 'Module', |
||
33 | 'Active', |
||
34 | 'Submodule' => ['final' => true] |
||
35 | ]; |
||
36 | |||
37 | protected $transitions = [ |
||
38 | 'create' => [ |
||
39 | 'from' => 'User', |
||
40 | 'to' => 'Enrollments' |
||
41 | ], |
||
42 | 'chose_enrollment' => [ |
||
43 | 'from' => 'Enrollments', |
||
44 | 'to' => 'Study' |
||
45 | ], |
||
46 | 'chose_module' => [ |
||
47 | 'from' => 'Study', |
||
48 | 'to' => 'Module' |
||
49 | ], |
||
50 | 'chose_submodules' => [ |
||
51 | 'from' => 'Module', |
||
52 | 'to' => 'Submodule' |
||
53 | ], |
||
54 | 'enrollment_status' => [ |
||
55 | 'from' => 'Submodule', |
||
56 | 'to' => 'Active' |
||
57 | ] |
||
58 | ]; |
||
59 | |||
60 | protected $events = [ |
||
61 | 'created' => EnrollmentCreated::class |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
66 | */ |
||
67 | public function user() |
||
71 | |||
72 | /** |
||
73 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
74 | */ |
||
75 | public function classroom() |
||
79 | |||
80 | public function course() |
||
84 | |||
85 | public function study() |
||
89 | |||
90 | |||
91 | // /** |
||
|
|||
92 | // * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
93 | // */ |
||
94 | // public function enrollment() |
||
95 | // { |
||
96 | // return $this->hasOne("Scool\EnrollmentMobile\Classroom"); |
||
97 | // } |
||
98 | } |
||
99 |
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.