| Conditions | 1 |
| Paths | 1 |
| Total Lines | 70 |
| Code Lines | 43 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 194 | protected function requestPatchCustomerPasswordFailsValidationDataProvider(): array |
||
| 195 | { |
||
| 196 | return [ |
||
| 197 | [ |
||
| 198 | 'attributes' => [ |
||
| 199 | RestCustomerPasswordAttributesTransfer::PASSWORD => 'change123', |
||
| 200 | RestCustomerPasswordAttributesTransfer::NEW_PASSWORD => 'qwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiop', |
||
| 201 | RestCustomerPasswordAttributesTransfer::CONFIRM_PASSWORD => 'qwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiop', |
||
| 202 | ], |
||
| 203 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, |
||
| 204 | 'errors' => [ |
||
| 205 | [ |
||
| 206 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, |
||
| 207 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, |
||
| 208 | RestErrorMessageTransfer::DETAIL => 'newPassword => This value is too long. It should have 64 characters or less.', |
||
| 209 | ], |
||
| 210 | [ |
||
| 211 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, |
||
| 212 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, |
||
| 213 | RestErrorMessageTransfer::DETAIL => 'confirmPassword => This value is too long. It should have 64 characters or less.', |
||
| 214 | ], |
||
| 215 | ], |
||
| 216 | ], |
||
| 217 | [ |
||
| 218 | 'attributes' => [ |
||
| 219 | RestCustomerPasswordAttributesTransfer::PASSWORD => 'change123', |
||
| 220 | RestCustomerPasswordAttributesTransfer::NEW_PASSWORD => 'qwe', |
||
| 221 | RestCustomerPasswordAttributesTransfer::CONFIRM_PASSWORD => 'qwe', |
||
| 222 | ], |
||
| 223 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, |
||
| 224 | 'errors' => [ |
||
| 225 | [ |
||
| 226 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, |
||
| 227 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, |
||
| 228 | RestErrorMessageTransfer::DETAIL => 'newPassword => This value is too short. It should have 8 characters or more.', |
||
| 229 | ], |
||
| 230 | [ |
||
| 231 | RestErrorMessageTransfer::CODE => RestRequestValidatorConfig::RESPONSE_CODE_REQUEST_INVALID, |
||
| 232 | RestErrorMessageTransfer::STATUS => Response::HTTP_UNPROCESSABLE_ENTITY, |
||
| 233 | RestErrorMessageTransfer::DETAIL => 'confirmPassword => This value is too short. It should have 8 characters or more.', |
||
| 234 | ], |
||
| 235 | ], |
||
| 236 | ], |
||
| 237 | [ |
||
| 238 | 'attributes' => [ |
||
| 239 | RestCustomerPasswordAttributesTransfer::PASSWORD => 'change123', |
||
| 240 | RestCustomerPasswordAttributesTransfer::NEW_PASSWORD => 'qwertyui', |
||
| 241 | RestCustomerPasswordAttributesTransfer::CONFIRM_PASSWORD => 'qwertyui', |
||
| 242 | ], |
||
| 243 | RestErrorMessageTransfer::STATUS => Response::HTTP_BAD_REQUEST, |
||
| 244 | 'errors' => [ |
||
| 245 | [ |
||
| 246 | RestErrorMessageTransfer::CODE => CustomersRestApiConfig::RESPONSE_CODE_CUSTOMER_PASSWORD_INVALID_CHARACTER_SET, |
||
| 247 | RestErrorMessageTransfer::STATUS => Response::HTTP_BAD_REQUEST, |
||
| 248 | RestErrorMessageTransfer::DETAIL => CustomersRestApiConfig::RESPONSE_MESSAGE_CUSTOMER_PASSWORD_INVALID_CHARACTER_SET, |
||
| 249 | ], |
||
| 250 | ], |
||
| 251 | ], |
||
| 252 | [ |
||
| 253 | 'attributes' => [ |
||
| 254 | RestCustomerPasswordAttributesTransfer::PASSWORD => 'change123', |
||
| 255 | RestCustomerPasswordAttributesTransfer::NEW_PASSWORD => 'qwertyuI1!eee', |
||
| 256 | RestCustomerPasswordAttributesTransfer::CONFIRM_PASSWORD => 'qwertyuI1!eee', |
||
| 257 | ], |
||
| 258 | RestErrorMessageTransfer::STATUS => Response::HTTP_BAD_REQUEST, |
||
| 259 | 'errors' => [ |
||
| 260 | [ |
||
| 261 | RestErrorMessageTransfer::CODE => CustomersRestApiConfig::RESPONSE_CODE_CUSTOMER_PASSWORD_SEQUENCE_NOT_ALLOWED, |
||
| 262 | RestErrorMessageTransfer::STATUS => Response::HTTP_BAD_REQUEST, |
||
| 263 | RestErrorMessageTransfer::DETAIL => CustomersRestApiConfig::RESPONSE_MESSAGE_CUSTOMER_PASSWORD_SEQUENCE_NOT_ALLOWED, |
||
| 264 | ], |
||
| 270 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths