| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 20 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function messages() |
||
| 34 | { |
||
| 35 | $messages = [ |
||
| 36 | 'kelas_id.required' => 'Kelas Rawah Inap belum di pilih', |
||
| 37 | 'kode_ruang.required' => 'Kode ruang Rawat Inap Masih Kosong', |
||
| 38 | 'nama_ruang.required' => 'Nama ruang Rawat Inap Tidak Boleh Kosong' |
||
| 39 | ]; |
||
| 40 | |||
| 41 | if ('PATCH' === $this->method()){ |
||
| 42 | |||
| 43 | $messages = [ |
||
| 44 | 'kelas_id.required' => 'Kelas Rawah Inap belum di pilih', |
||
| 45 | 'kode_ruang.required' => 'Kode ruang Rawat Inap tidak boleh kosong', |
||
| 46 | 'nama_ruang.required' => 'Nama ruang Rawat Inap Tidak Boleh Kosong' |
||
| 47 | ]; |
||
| 48 | |||
| 49 | } |
||
| 50 | |||
| 51 | return $messages; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.