| Conditions | 1 |
| Paths | 1 |
| Total Lines | 113 |
| 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 |
||
| 119 | protected function getExpectation() |
||
| 120 | { |
||
| 121 | return array( |
||
| 122 | 0 => new UrlAlias( |
||
| 123 | array( |
||
| 124 | 'id' => '1-f97c5d29941bfb1b2fdab0874906ab82', |
||
| 125 | 'type' => UrlAlias::LOCATION, |
||
| 126 | 'destination' => 314, |
||
| 127 | 'pathData' => array( |
||
| 128 | array( |
||
| 129 | 'always-available' => false, |
||
| 130 | 'translations' => array( |
||
| 131 | 'eng-US' => 'root_us', |
||
| 132 | 'eng-GB' => 'root_gb', |
||
| 133 | ), |
||
| 134 | ), |
||
| 135 | array( |
||
| 136 | 'always-available' => false, |
||
| 137 | 'translations' => array( |
||
| 138 | 'eng-GB' => 'one', |
||
| 139 | ), |
||
| 140 | ), |
||
| 141 | ), |
||
| 142 | 'languageCodes' => array('eng-GB'), |
||
| 143 | 'alwaysAvailable' => true, |
||
| 144 | 'isHistory' => false, |
||
| 145 | 'isCustom' => true, |
||
| 146 | 'forward' => false, |
||
| 147 | ) |
||
| 148 | ), |
||
| 149 | 1 => new UrlAlias( |
||
| 150 | array( |
||
| 151 | 'id' => '2-b8a9f715dbb64fd5c56e7783c6820a61', |
||
| 152 | 'type' => UrlAlias::LOCATION, |
||
| 153 | 'destination' => 314, |
||
| 154 | 'pathData' => array( |
||
| 155 | array( |
||
| 156 | 'always-available' => true, |
||
| 157 | 'translations' => array( |
||
| 158 | 'eng-US' => 'two', |
||
| 159 | ), |
||
| 160 | ), |
||
| 161 | ), |
||
| 162 | 'languageCodes' => array('eng-US'), |
||
| 163 | 'alwaysAvailable' => true, |
||
| 164 | 'isHistory' => true, |
||
| 165 | 'isCustom' => false, |
||
| 166 | 'forward' => false, |
||
| 167 | ) |
||
| 168 | ), |
||
| 169 | 2 => new UrlAlias( |
||
| 170 | array( |
||
| 171 | 'id' => '0-35d6d33467aae9a2e3dccb4b6b027878', |
||
| 172 | 'type' => UrlAlias::RESOURCE, |
||
| 173 | 'destination' => 'content/search', |
||
| 174 | 'pathData' => array( |
||
| 175 | array( |
||
| 176 | 'always-available' => false, |
||
| 177 | 'translations' => array( |
||
| 178 | 'eng-US' => 'three', |
||
| 179 | 'eng-GB' => 'three', |
||
| 180 | ), |
||
| 181 | ), |
||
| 182 | ), |
||
| 183 | 'languageCodes' => array('eng-US', 'eng-GB'), |
||
| 184 | 'alwaysAvailable' => false, |
||
| 185 | 'isHistory' => false, |
||
| 186 | 'isCustom' => true, |
||
| 187 | 'forward' => true, |
||
| 188 | ) |
||
| 189 | ), |
||
| 190 | 3 => new UrlAlias( |
||
| 191 | array( |
||
| 192 | 'id' => '3-8cbad96aced40b3838dd9f07f6ef5772', |
||
| 193 | 'type' => UrlAlias::VIRTUAL, |
||
| 194 | 'destination' => null, |
||
| 195 | 'pathData' => array( |
||
| 196 | array( |
||
| 197 | 'always-available' => true, |
||
| 198 | 'translations' => array( |
||
| 199 | 'always-available' => 'four', |
||
| 200 | ), |
||
| 201 | ), |
||
| 202 | ), |
||
| 203 | 'languageCodes' => array(), |
||
| 204 | 'alwaysAvailable' => true, |
||
| 205 | 'isHistory' => true, |
||
| 206 | 'isCustom' => false, |
||
| 207 | 'forward' => false, |
||
| 208 | ) |
||
| 209 | ), |
||
| 210 | 4 => new UrlAlias( |
||
| 211 | array( |
||
| 212 | 'id' => '3-1d8d2fd0a99802b89eb356a86e029d25', |
||
| 213 | 'type' => UrlAlias::VIRTUAL, |
||
| 214 | 'destination' => null, |
||
| 215 | 'pathData' => array( |
||
| 216 | array( |
||
| 217 | 'always-available' => false, |
||
| 218 | 'translations' => array( |
||
| 219 | 'ger-DE' => 'drei', |
||
| 220 | ), |
||
| 221 | ), |
||
| 222 | ), |
||
| 223 | 'languageCodes' => array('ger-DE'), |
||
| 224 | 'alwaysAvailable' => false, |
||
| 225 | 'isHistory' => true, |
||
| 226 | 'isCustom' => false, |
||
| 227 | 'forward' => false, |
||
| 228 | ) |
||
| 229 | ), |
||
| 230 | ); |
||
| 231 | } |
||
| 232 | |||
| 299 |