| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 18 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function messages() |
||
| 33 | { |
||
| 34 | $messages = [ |
||
| 35 | 'kode_kelas.required' => 'Kode Kelas Rawat Inap Masih Kosong', |
||
| 36 | 'nama_kelas.required' => 'Nama Kelas Rawat Inap Tidak Boleh Kosong' |
||
| 37 | ]; |
||
| 38 | |||
| 39 | if ('PATCH' === $this->method()){ |
||
| 40 | |||
| 41 | $messages = [ |
||
| 42 | 'kode_kelas.required' => 'Kode Kelas Rawat Inap tidak boleh kosong', |
||
| 43 | 'nama_kelas.required' => 'Nama Kelas Rawat Inap Tidak Boleh Kosong' |
||
| 44 | ]; |
||
| 45 | |||
| 46 | } |
||
| 47 | |||
| 48 | return $messages; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
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.