| Conditions | 1 |
| Paths | 1 |
| Total Lines | 53 |
| Code Lines | 43 |
| 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 |
||
| 77 | protected function process() |
||
| 78 | { |
||
| 79 | |||
| 80 | // initialize the array for the links |
||
| 81 | $artefacts = array(); |
||
| 82 | |||
| 83 | $artefacts[] = $this->newArtefact( |
||
| 84 | array( |
||
| 85 | ColumnKeys::ENTITY_ID => null, |
||
| 86 | ColumnKeys::WEBSITE => $this->getValue(ColumnKeys::WEBSITE), |
||
| 87 | ColumnKeys::EMAIL => $this->getValue(ColumnKeys::EMAIL), |
||
| 88 | ColumnKeys::CITY => $this->getValue(ColumnKeys::ADDRESS_CITY), |
||
| 89 | ColumnKeys::COMPANY => $this->getValue(ColumnKeys::ADDRESS_COMPANY), |
||
| 90 | ColumnKeys::COUNTRY_ID => $this->getValue(ColumnKeys::ADDRESS_COUNTRY_ID), |
||
| 91 | ColumnKeys::FAX => $this->getValue(ColumnKeys::ADDRESS_FAX), |
||
| 92 | ColumnKeys::FIRSTNAME => $this->getValue(ColumnKeys::ADDRESS_FIRSTNAME), |
||
| 93 | ColumnKeys::LASTNAME => $this->getValue(ColumnKeys::ADDRESS_LASTNAME), |
||
| 94 | ColumnKeys::MIDDLENAME => $this->getValue(ColumnKeys::ADDRESS_MIDDLENAME), |
||
| 95 | ColumnKeys::POSTCODE => $this->getValue(ColumnKeys::ADDRESS_POSTCODE), |
||
| 96 | ColumnKeys::PREFIX => $this->getValue(ColumnKeys::ADDRESS_PREFIX), |
||
| 97 | ColumnKeys::REGION => $this->getValue(ColumnKeys::ADDRESS_REGION), |
||
| 98 | ColumnKeys::STREET => $this->getValue(ColumnKeys::ADDRESS_STREET), |
||
| 99 | ColumnKeys::SUFFIX => $this->getValue(ColumnKeys::ADDRESS_SUFFIX), |
||
| 100 | ColumnKeys::TELEPHONE => $this->getValue(ColumnKeys::ADDRESS_TELEPHONE), |
||
| 101 | ColumnKeys::VAT_ID => $this->getValue(ColumnKeys::ADDRESS_VAT_ID), |
||
| 102 | ColumnKeys::DEFAULT_BILLING => $this->getValue(ColumnKeys::ADDRESS_DEFAULT_BILLING), |
||
| 103 | ColumnKeys::DEFAULT_SHIPPING => $this->getValue(ColumnKeys::ADDRESS_DEFAULT_SHIPPING) |
||
| 104 | ), |
||
| 105 | array( |
||
| 106 | ColumnKeys::ENTITY_ID => null, |
||
| 107 | ColumnKeys::WEBSITE => ColumnKeys::WEBSITE, |
||
| 108 | ColumnKeys::EMAIL => ColumnKeys::EMAIL, |
||
| 109 | ColumnKeys::CITY => ColumnKeys::ADDRESS_CITY, |
||
| 110 | ColumnKeys::COMPANY => ColumnKeys::ADDRESS_COMPANY, |
||
| 111 | ColumnKeys::COUNTRY_ID => ColumnKeys::ADDRESS_COUNTRY_ID, |
||
| 112 | ColumnKeys::FAX => ColumnKeys::ADDRESS_FAX, |
||
| 113 | ColumnKeys::FIRSTNAME => ColumnKeys::ADDRESS_FIRSTNAME, |
||
| 114 | ColumnKeys::LASTNAME => ColumnKeys::ADDRESS_LASTNAME, |
||
| 115 | ColumnKeys::MIDDLENAME => ColumnKeys::ADDRESS_MIDDLENAME, |
||
| 116 | ColumnKeys::POSTCODE => ColumnKeys::ADDRESS_POSTCODE, |
||
| 117 | ColumnKeys::PREFIX => ColumnKeys::ADDRESS_PREFIX, |
||
| 118 | ColumnKeys::REGION => ColumnKeys::ADDRESS_REGION, |
||
| 119 | ColumnKeys::STREET => ColumnKeys::ADDRESS_STREET, |
||
| 120 | ColumnKeys::SUFFIX => ColumnKeys::ADDRESS_SUFFIX, |
||
| 121 | ColumnKeys::TELEPHONE => ColumnKeys::ADDRESS_TELEPHONE, |
||
| 122 | ColumnKeys::VAT_ID => ColumnKeys::ADDRESS_VAT_ID, |
||
| 123 | ColumnKeys::DEFAULT_BILLING => ColumnKeys::ADDRESS_DEFAULT_BILLING, |
||
| 124 | ColumnKeys::DEFAULT_SHIPPING => ColumnKeys::ADDRESS_DEFAULT_SHIPPING |
||
| 125 | ) |
||
| 126 | ); |
||
| 127 | |||
| 128 | // append the links to the subject |
||
| 129 | $this->addArtefacts($artefacts); |
||
| 130 | } |
||
| 158 | } |