| Conditions | 6 |
| Paths | 16 |
| Total Lines | 53 |
| Code Lines | 28 |
| 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 |
||
| 45 | protected function convertStatusToTransfer(array $statusData) |
||
| 46 | { |
||
| 47 | $status = new AmazonpayStatusTransfer(); |
||
| 48 | |||
| 49 | if (!empty($statusData['LastUpdateTimestamp'])) { |
||
| 50 | $status->setLastUpdateTimestamp($statusData['LastUpdateTimestamp']); |
||
| 51 | } |
||
| 52 | |||
| 53 | $status->setState($statusData['State']); |
||
| 54 | |||
| 55 | if (!empty($statusData['ReasonCode'])) { |
||
| 56 | $status->setReasonCode($statusData['ReasonCode']); |
||
| 57 | $status->setIsReauthorizable( |
||
| 58 | $statusData['ReasonCode'] === AmazonpayConstants::REASON_CODE_SELLER_CLOSED |
||
| 59 | || $statusData['ReasonCode'] === AmazonpayConstants::REASON_CODE_EXPIRED_UNUSED |
||
| 60 | ); |
||
| 61 | |||
| 62 | $status->setIsPaymentMethodInvalid( |
||
| 63 | $statusData['ReasonCode'] === AmazonpayConstants::REASON_CODE_PAYMENT_METHOD_INVALID |
||
| 64 | ); |
||
| 65 | |||
| 66 | $status->setIsClosedByAmazon( |
||
| 67 | $statusData['ReasonCode'] === AmazonpayConstants::REASON_CODE_AMAZON_CLOSED |
||
| 68 | ); |
||
| 69 | } |
||
| 70 | |||
| 71 | if ($statusData['State'] === static::STATUS_DECLINED) { |
||
| 72 | $status->setIsSuspended($status->getIsPaymentMethodInvalid()); |
||
| 73 | $status->setIsDeclined(true); |
||
| 74 | } |
||
| 75 | |||
| 76 | if ($statusData['State'] === static::STATUS_SUSPENDED) { |
||
| 77 | $status->setIsSuspended(true); |
||
| 78 | $status->setIsDeclined(true); |
||
| 79 | } |
||
| 80 | |||
| 81 | $status->setIsPending( |
||
| 82 | $statusData['State'] === static::STATUS_PENDING |
||
| 83 | ); |
||
| 84 | |||
| 85 | $status->setIsOpen( |
||
| 86 | $statusData['State'] === static::STATUS_OPEN |
||
| 87 | ); |
||
| 88 | |||
| 89 | $status->setIsClosed( |
||
| 90 | $statusData['State'] === static::STATUS_CLOSED |
||
| 91 | ); |
||
| 92 | |||
| 93 | $status->setIsCompleted( |
||
| 94 | $statusData['State'] === static::STATUS_COMPLETED |
||
| 95 | ); |
||
| 96 | |||
| 97 | return $status; |
||
| 98 | } |
||
| 122 |
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