| Conditions | 5 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 13 |
| Lines | 3 |
| Ratio | 17.65 % |
| 1 | <?php |
||
| 13 | public function manualClosePayAction($payId) |
||
| 14 | { |
||
| 15 | $pay = \Money\Pay::get((int) $payId); |
||
| 16 | $result = new Server\Result(); |
||
| 17 | if ($pay && $pay->pay_status_id == 1) { |
||
| 18 | $pay->pay_status_id = 2; |
||
| 19 | $pay->save(); |
||
| 20 | View Code Duplication | if ($pay->callback_module && $pay->callback_method) { |
|
|
|
|||
| 21 | \App::$primary->{$pay->callback_module}->{$pay->callback_method}(['status' => 'success', 'payId' => $pay->id, 'pay' => $pay]); |
||
| 22 | } |
||
| 23 | $result->successMsg = 'Счет был проведен'; |
||
| 24 | $result->send(); |
||
| 25 | } |
||
| 26 | $result->success = false; |
||
| 27 | $result->content = 'Такой счет не найден'; |
||
| 28 | $result->send(); |
||
| 29 | } |
||
| 30 | |||
| 57 |
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.