| Conditions | 1 |
| Paths | 1 |
| Total Lines | 80 |
| Code Lines | 60 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 31 | protected function defineControllers(Application $app): void |
||
| 32 | { |
||
| 33 | $this->createController( |
||
| 34 | '/heidelpay/payment-failed', |
||
| 35 | static::HEIDELPAY_PAYMENT_FAILED, |
||
| 36 | 'Heidelpay', |
||
| 37 | 'Heidelpay', |
||
| 38 | 'paymentFailed' |
||
| 39 | ); |
||
| 40 | |||
| 41 | $this->createController( |
||
| 42 | '/heidelpay/payment', |
||
| 43 | static::HEIDELPAY_PAYMENT, |
||
| 44 | 'Heidelpay', |
||
| 45 | 'Heidelpay', |
||
| 46 | 'payment' |
||
| 47 | ); |
||
| 48 | |||
| 49 | $this->createController( |
||
| 50 | '/heidelpay/easyCreditPayment', |
||
| 51 | static::HEIDELPAY_EASY_CREDIT_PAYMENT, |
||
| 52 | 'Heidelpay', |
||
| 53 | 'EasyCredit', |
||
| 54 | 'easyCreditPayment' |
||
| 55 | ); |
||
| 56 | |||
| 57 | $this->createController( |
||
| 58 | '/heidelpay/easyCreditInitializePayment', |
||
| 59 | static::HEIDELPAY_EASY_CREDIT_INITIALIZE_PAYMENT, |
||
| 60 | 'Heidelpay', |
||
| 61 | 'EasyCredit', |
||
| 62 | 'easyCreditInitializePayment' |
||
| 63 | ); |
||
| 64 | |||
| 65 | $this->createController( |
||
| 66 | '/heidelpay/ideal-authorize', |
||
| 67 | static::HEIDELPAY_IDEAL_AUTHORIZE, |
||
| 68 | 'Heidelpay', |
||
| 69 | 'Ideal', |
||
| 70 | 'authorize' |
||
| 71 | ); |
||
| 72 | |||
| 73 | $this->createController( |
||
| 74 | '/heidelpay/cc-register-response', |
||
| 75 | static::HEIDELPAY_CREDIT_CARD_REGISTER, |
||
| 76 | 'Heidelpay', |
||
| 77 | 'CreditCard', |
||
| 78 | 'registrationRequest' |
||
| 79 | ); |
||
| 80 | |||
| 81 | $this->createController( |
||
| 82 | '/heidelpay/cc-register-success', |
||
| 83 | static::HEIDELPAY_CREDIT_CARD_REGISTER_SUCCESS, |
||
| 84 | 'Heidelpay', |
||
| 85 | 'CreditCard', |
||
| 86 | 'registrationSuccess' |
||
| 87 | ); |
||
| 88 | |||
| 89 | $this->createPostController( |
||
| 90 | '/heidelpay/notification', |
||
| 91 | static::HEIDELPAY_NOTIFICATION, |
||
| 92 | 'Heidelpay', |
||
| 93 | 'Notification', |
||
| 94 | 'index' |
||
| 95 | ); |
||
| 96 | |||
| 97 | $this->createPostController( |
||
| 98 | '/heidelpay/dd-register-response', |
||
| 99 | static::HEIDELPAY_DIRECT_DEBIT_REGISTER, |
||
| 100 | 'Heidelpay', |
||
| 101 | 'DirectDebit', |
||
| 102 | 'registrationRequest' |
||
| 103 | ); |
||
| 104 | |||
| 105 | $this->createController( |
||
| 106 | '/heidelpay/dd-register-success', |
||
| 107 | static::HEIDELPAY_DIRECT_DEBIT_REGISTER_SUCCESS, |
||
| 108 | 'Heidelpay', |
||
| 109 | 'DirectDebit', |
||
| 110 | 'registrationSuccess' |
||
| 111 | ); |
||
| 114 |