Conditions | 1 |
Paths | 1 |
Total Lines | 80 |
Code Lines | 60 |
Lines | 0 |
Ratio | 0 % |
Changes | 7 | ||
Bugs | 0 | Features | 3 |
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 |
||
45 | protected function defineControllers(Application $app) |
||
46 | { |
||
47 | $this->createController( |
||
48 | '/computop/credit-card-success', |
||
49 | self::CREDIT_CARD_SUCCESS, |
||
50 | $this->moduleName, |
||
51 | $this->callbackControllerName, |
||
52 | 'successCreditCard' |
||
53 | ); |
||
54 | |||
55 | $this->createController( |
||
56 | '/computop/paynow-success', |
||
57 | self::PAY_NOW_SUCCESS, |
||
58 | $this->moduleName, |
||
59 | $this->callbackControllerName, |
||
60 | 'successPayNow' |
||
61 | ); |
||
62 | |||
63 | $this->createController( |
||
64 | '/computop/direct-debit-success', |
||
65 | self::DIRECT_DEBIT_SUCCESS, |
||
66 | $this->moduleName, |
||
67 | $this->callbackControllerName, |
||
68 | 'successDirectDebit' |
||
69 | ); |
||
70 | |||
71 | $this->createController( |
||
72 | '/computop/easy-credit-success', |
||
73 | self::EASY_CREDIT_SUCCESS, |
||
74 | $this->moduleName, |
||
75 | $this->callbackControllerName, |
||
76 | 'successEasyCredit' |
||
77 | ); |
||
78 | |||
79 | $this->createController( |
||
80 | '/computop/ideal-success', |
||
81 | self::IDEAL_SUCCESS, |
||
82 | $this->moduleName, |
||
83 | $this->callbackControllerName, |
||
84 | 'successIdeal' |
||
85 | ); |
||
86 | |||
87 | $this->createController( |
||
88 | '/computop/paydirekt-success', |
||
89 | self::PAYDIREKT_SUCCESS, |
||
90 | $this->moduleName, |
||
91 | $this->callbackControllerName, |
||
92 | 'successPaydirekt' |
||
93 | ); |
||
94 | |||
95 | $this->createController( |
||
96 | '/computop/pay-pal-success', |
||
97 | self::PAY_PAL_SUCCESS, |
||
98 | $this->moduleName, |
||
99 | $this->callbackControllerName, |
||
100 | 'successPayPal' |
||
101 | ); |
||
102 | |||
103 | $this->createController( |
||
104 | '/computop/sofort-success', |
||
105 | self::SOFORT_SUCCESS, |
||
106 | $this->moduleName, |
||
107 | $this->callbackControllerName, |
||
108 | 'successSofort' |
||
109 | ); |
||
110 | |||
111 | $this->createController( |
||
112 | '/computop/failure', |
||
113 | self::FAILURE_PATH_NAME, |
||
114 | $this->moduleName, |
||
115 | $this->callbackControllerName, |
||
116 | 'failure' |
||
117 | ); |
||
118 | |||
119 | $this->createController( |
||
120 | '/computop/notify', |
||
121 | self::NOTIFY_PATH_NAME, |
||
122 | $this->moduleName, |
||
123 | $this->callbackControllerName, |
||
124 | 'notify' |
||
125 | ); |
||
128 |