Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public function writer() { |
||
38 | $adminId = $this->getAttributeValue('admin_id'); |
||
39 | $doctorId = $this->getAttributeValue('doctor_id'); |
||
40 | |||
41 | $writer = ['role', 'data']; |
||
42 | |||
43 | if($adminId != null) { |
||
44 | $writer['role'] = "Admin"; |
||
45 | $writer['data'] = Admin::find($adminId); |
||
46 | } elseif($doctorId != null) { |
||
47 | $writer['role'] = "Dokter"; |
||
48 | $writer['data'] = Doctor::find($doctorId); |
||
49 | } |
||
50 | |||
51 | return $writer; |
||
52 | } |
||
81 |
The
break
statement is not necessary if it is preceded for example by areturn
statement:If you would like to keep this construct to be consistent with other
case
statements, you can safely mark this issue as a false-positive.