| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 19 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function messages() |
||
| 34 | { |
||
| 35 | $messages = [ |
||
| 36 | 'ruang_id.required' => 'Nama Ruangan belum di pilih', |
||
| 37 | 'kode_bed.required' => 'Kode Tempat Tidur Masih Kosong' |
||
| 38 | ]; |
||
| 39 | |||
| 40 | if ('PATCH' === $this->method()){ |
||
| 41 | |||
| 42 | $messages = [ |
||
| 43 | 'ruang_id.required' => 'Nama Ruangan belum di pilih', |
||
| 44 | 'kode_bed.required' => 'Kode Tempat Tidur tidak boleh kosong' |
||
| 45 | |||
| 46 | ]; |
||
| 47 | |||
| 48 | } |
||
| 49 | |||
| 50 | return $messages; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
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.