| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 60 | 
| Code Lines | 37 | 
| 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 | ||
| 196 | protected function requestPatchCustomerPasswordFailsValidationDataProvider(): array | ||
| 197 |     { | ||
| 198 | return [ | ||
| 199 | [ | ||
| 200 | 'attributes' => [ | ||
| 201 | RestCustomerPasswordAttributesTransfer::PASSWORD => 'change123', | ||
| 202 | RestCustomerPasswordAttributesTransfer::NEW_PASSWORD => 'Change!23456pqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuioppqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwert', | ||
| 203 | RestCustomerPasswordAttributesTransfer::CONFIRM_PASSWORD => 'Change!23456pqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuioppqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwert', | ||
| 204 | ], | ||
| 205 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
| 206 | 'errors' => [ | ||
| 207 | [ | ||
| 208 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, | ||
| 209 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
| 210 | RestErrorMessageTransfer::DETAIL => 'newPassword => This value is too long. It should have 128 characters or less.', | ||
| 211 | ], | ||
| 212 | [ | ||
| 213 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, | ||
| 214 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
| 215 | RestErrorMessageTransfer::DETAIL => 'confirmPassword => This value is too long. It should have 128 characters or less.', | ||
| 216 | ], | ||
| 217 | ], | ||
| 218 | ], | ||
| 219 | [ | ||
| 220 | 'attributes' => [ | ||
| 221 | RestCustomerPasswordAttributesTransfer::PASSWORD => 'change123', | ||
| 222 | RestCustomerPasswordAttributesTransfer::NEW_PASSWORD => 'qwe', | ||
| 223 | RestCustomerPasswordAttributesTransfer::CONFIRM_PASSWORD => 'qwe', | ||
| 224 | ], | ||
| 225 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
| 226 | 'errors' => [ | ||
| 227 | [ | ||
| 228 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, | ||
| 229 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
| 230 | RestErrorMessageTransfer::DETAIL => 'newPassword => This value is too short. It should have 12 characters or more.', | ||
| 231 | ], | ||
| 232 | [ | ||
| 233 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, | ||
| 234 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
| 235 |                         RestErrorMessageTransfer::DETAIL => 'newPassword => Your password must include at least one uppercase letter, one lowercase letter, one number, and one special character from the following list: !@#$%^&*()_-+=[]{}|;:<>.,/?\~. Non-Latin and other special characters are not allowed.', | ||
| 236 | ], | ||
| 237 | [ | ||
| 238 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, | ||
| 239 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, | ||
| 240 | RestErrorMessageTransfer::DETAIL => 'confirmPassword => This value is too short. It should have 12 characters or more.', | ||
| 241 | ], | ||
| 242 | ], | ||
| 243 | ], | ||
| 244 | [ | ||
| 245 | 'attributes' => [ | ||
| 246 | RestCustomerPasswordAttributesTransfer::PASSWORD => 'change123', | ||
| 247 | RestCustomerPasswordAttributesTransfer::NEW_PASSWORD => 'Change!23456eee', | ||
| 248 | RestCustomerPasswordAttributesTransfer::CONFIRM_PASSWORD => 'Change!23456eee', | ||
| 249 | ], | ||
| 250 | RestErrorMessageTransfer::STATUS => Response::HTTP_BAD_REQUEST, | ||
| 251 | 'errors' => [ | ||
| 252 | [ | ||
| 253 | RestErrorMessageTransfer::CODE => CustomersRestApiConfig::RESPONSE_CODE_CUSTOMER_PASSWORD_SEQUENCE_NOT_ALLOWED, | ||
| 254 | RestErrorMessageTransfer::STATUS => Response::HTTP_BAD_REQUEST, | ||
| 255 | RestErrorMessageTransfer::DETAIL => CustomersRestApiConfig::RESPONSE_MESSAGE_CUSTOMER_PASSWORD_SEQUENCE_NOT_ALLOWED, | ||
| 256 | ], | ||
| 262 |