Complex classes like Payone_Api_Response_Authorization_Abstract often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Payone_Api_Response_Authorization_Abstract, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 33 | abstract class Payone_Api_Response_Authorization_Abstract |
||
| 34 | extends Payone_Api_Response_Abstract |
||
| 35 | { |
||
| 36 | /** |
||
| 37 | * @var int |
||
| 38 | */ |
||
| 39 | protected $txid = NULL; |
||
| 40 | /** |
||
| 41 | * @var int |
||
| 42 | */ |
||
| 43 | protected $userid = NULL; |
||
| 44 | /** |
||
| 45 | * @var string |
||
| 46 | */ |
||
| 47 | protected $protect_result_avs = NULL; |
||
| 48 | /** |
||
| 49 | * @var string |
||
| 50 | */ |
||
| 51 | protected $clearing_bankaccountholder = NULL; |
||
| 52 | /** |
||
| 53 | * @var string |
||
| 54 | */ |
||
| 55 | protected $clearing_bankcountry = NULL; |
||
| 56 | /** |
||
| 57 | * @var string |
||
| 58 | */ |
||
| 59 | protected $clearing_bankaccount = NULL; |
||
| 60 | /** |
||
| 61 | * @var string |
||
| 62 | */ |
||
| 63 | protected $clearing_bankcode = NULL; |
||
| 64 | /** |
||
| 65 | * @var string |
||
| 66 | */ |
||
| 67 | protected $clearing_bankiban = NULL; |
||
| 68 | /** |
||
| 69 | * @var string |
||
| 70 | */ |
||
| 71 | protected $clearing_bankbic = NULL; |
||
| 72 | /** |
||
| 73 | * @var string |
||
| 74 | */ |
||
| 75 | protected $clearing_bankcity = NULL; |
||
| 76 | /** |
||
| 77 | * @var string |
||
| 78 | */ |
||
| 79 | protected $clearing_bankname = NULL; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @var string |
||
| 83 | */ |
||
| 84 | protected $mandate_identification = NULL; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @var string |
||
| 88 | */ |
||
| 89 | protected $paydata_content_encoding = NULL; |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @var string |
||
| 93 | */ |
||
| 94 | protected $paydata_instruction_notes = NULL; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @var string |
||
| 98 | */ |
||
| 99 | protected $paydata_content_format = NULL; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * @var string |
||
| 103 | */ |
||
| 104 | protected $clearing_instructionnote = NULL; |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @var string |
||
| 108 | */ |
||
| 109 | protected $clearing_reference = NULL; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @var string |
||
| 113 | */ |
||
| 114 | protected $clearing_legalnote = NULL; |
||
| 115 | |||
| 116 | /** |
||
| 117 | * @var string |
||
| 118 | */ |
||
| 119 | protected $clearing_duedate = NULL; |
||
| 120 | |||
| 121 | protected $paydata_clearing_reference = NULL; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * @param string $clearing_bankaccount |
||
| 125 | */ |
||
| 126 | public function setClearingBankaccount($clearing_bankaccount) |
||
| 130 | |||
| 131 | /** |
||
| 132 | * @return string |
||
| 133 | */ |
||
| 134 | public function getClearingBankaccount() |
||
| 138 | |||
| 139 | /** |
||
| 140 | * @param string $clearing_bankaccountholder |
||
| 141 | */ |
||
| 142 | public function setClearingBankaccountholder($clearing_bankaccountholder) |
||
| 146 | |||
| 147 | /** |
||
| 148 | * @return string |
||
| 149 | */ |
||
| 150 | public function getClearingBankaccountholder() |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @param string $clearing_bankbic |
||
| 157 | */ |
||
| 158 | public function setClearingBankbic($clearing_bankbic) |
||
| 162 | |||
| 163 | /** |
||
| 164 | * @return string |
||
| 165 | */ |
||
| 166 | public function getClearingBankbic() |
||
| 170 | |||
| 171 | /** |
||
| 172 | * @param string $clearing_bankcity |
||
| 173 | */ |
||
| 174 | public function setClearingBankcity($clearing_bankcity) |
||
| 178 | |||
| 179 | /** |
||
| 180 | * @return string |
||
| 181 | */ |
||
| 182 | public function getClearingBankcity() |
||
| 186 | |||
| 187 | /** |
||
| 188 | * @param string $clearing_bankcode |
||
| 189 | */ |
||
| 190 | public function setClearingBankcode($clearing_bankcode) |
||
| 194 | |||
| 195 | /** |
||
| 196 | * @return string |
||
| 197 | */ |
||
| 198 | public function getClearingBankcode() |
||
| 202 | |||
| 203 | /** |
||
| 204 | * @param string $clearing_bankcountry |
||
| 205 | */ |
||
| 206 | public function setClearingBankcountry($clearing_bankcountry) |
||
| 210 | |||
| 211 | /** |
||
| 212 | * @return string |
||
| 213 | */ |
||
| 214 | public function getClearingBankcountry() |
||
| 218 | |||
| 219 | /** |
||
| 220 | * @param string $clearing_bankiban |
||
| 221 | */ |
||
| 222 | public function setClearingBankiban($clearing_bankiban) |
||
| 226 | |||
| 227 | /** |
||
| 228 | * @return string |
||
| 229 | */ |
||
| 230 | public function getClearingBankiban() |
||
| 234 | |||
| 235 | /** |
||
| 236 | * @param string $clearing_bankname |
||
| 237 | */ |
||
| 238 | public function setClearingBankname($clearing_bankname) |
||
| 242 | |||
| 243 | /** |
||
| 244 | * @return string |
||
| 245 | */ |
||
| 246 | public function getClearingBankname() |
||
| 250 | |||
| 251 | /** |
||
| 252 | * @param string $protect_result_avs |
||
| 253 | */ |
||
| 254 | public function setProtectResultAvs($protect_result_avs) |
||
| 258 | |||
| 259 | /** |
||
| 260 | * @return string |
||
| 261 | */ |
||
| 262 | public function getProtectResultAvs() |
||
| 266 | |||
| 267 | /** |
||
| 268 | * @param int $txid |
||
| 269 | */ |
||
| 270 | public function setTxid($txid) |
||
| 274 | |||
| 275 | /** |
||
| 276 | * @return int |
||
| 277 | */ |
||
| 278 | public function getTxid() |
||
| 282 | |||
| 283 | /** |
||
| 284 | * @param int $userid |
||
| 285 | */ |
||
| 286 | public function setUserid($userid) |
||
| 290 | |||
| 291 | /** |
||
| 292 | * @return int |
||
| 293 | */ |
||
| 294 | public function getUserid() |
||
| 298 | |||
| 299 | /** |
||
| 300 | * @param string $mandateIdentification |
||
| 301 | */ |
||
| 302 | public function setMandateIdentification($mandateIdentification) |
||
| 306 | |||
| 307 | /** |
||
| 308 | * @return string |
||
| 309 | */ |
||
| 310 | public function getMandateIdentification() |
||
| 314 | |||
| 315 | /** |
||
| 316 | * @param string $sContentEncoding |
||
| 317 | */ |
||
| 318 | public function setAddPaydataContentEncoding($sContentEncoding) |
||
| 322 | |||
| 323 | /** |
||
| 324 | * @return string |
||
| 325 | */ |
||
| 326 | public function getAddPaydataContentEncoding() |
||
| 330 | |||
| 331 | /** |
||
| 332 | * @param string $sInstructionNotes |
||
| 333 | */ |
||
| 334 | public function setAddPaydataInstructionNotes($sInstructionNotes) |
||
| 338 | |||
| 339 | /** |
||
| 340 | * @return string |
||
| 341 | */ |
||
| 342 | public function getAddPaydataInstructionNotes() |
||
| 346 | |||
| 347 | /** |
||
| 348 | * @param string $sContentFormat |
||
| 349 | */ |
||
| 350 | public function setAddPaydataContentFormat($sContentFormat) |
||
| 354 | |||
| 355 | /** |
||
| 356 | * @return string |
||
| 357 | */ |
||
| 358 | public function getAddPaydataContentFormat() |
||
| 362 | |||
| 363 | /** |
||
| 364 | * @param string $clearing_instructionnote |
||
| 365 | */ |
||
| 366 | public function setClearingInstructionnote($clearing_instructionnote) |
||
| 370 | |||
| 371 | /** |
||
| 372 | * @return string |
||
| 373 | */ |
||
| 374 | public function getClearingInstructionnote() |
||
| 378 | |||
| 379 | /** |
||
| 380 | * @param string $clearing_reference |
||
| 381 | */ |
||
| 382 | public function setClearingReference($clearing_reference) |
||
| 386 | |||
| 387 | /** |
||
| 388 | * @return string |
||
| 389 | */ |
||
| 390 | public function getClearingReference() |
||
| 394 | |||
| 395 | /** |
||
| 396 | * @param string $clearing_legalnote |
||
| 397 | */ |
||
| 398 | public function setClearingLegalnote($clearing_legalnote) |
||
| 402 | |||
| 403 | /** |
||
| 404 | * @return string |
||
| 405 | */ |
||
| 406 | public function getClearingLegalnote() |
||
| 410 | |||
| 411 | /** |
||
| 412 | * @param string $clearing_duedate |
||
| 413 | */ |
||
| 414 | public function setClearingDuedate($clearing_duedate) |
||
| 418 | |||
| 419 | /** |
||
| 420 | * @return string |
||
| 421 | */ |
||
| 422 | public function getClearingDuedate() |
||
| 426 | |||
| 427 | public function getAddPaydataClearingReference() |
||
| 431 | |||
| 432 | public function setAddPaydataClearingReference($sClearingReference) |
||
| 436 | |||
| 437 | } |
||
| 438 |