Conditions | 11 |
Paths | 1024 |
Total Lines | 49 |
Code Lines | 25 |
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 |
||
23 | public function convert(array $authDetailsData) |
||
24 | { |
||
25 | $authorizationDetails = new AmazonpayAuthorizationDetailsTransfer(); |
||
26 | $authorizationDetails->setAmazonAuthorizationId($authDetailsData['AmazonAuthorizationId']); |
||
27 | $authorizationDetails->setAuthorizationReferenceId($authDetailsData['AuthorizationReferenceId']); |
||
28 | |||
29 | if (!empty($authDetailsData['AuthorizationAmount'])) { |
||
30 | $authorizationDetails->setAuthorizationAmount($this->convertPriceToTransfer($authDetailsData['AuthorizationAmount'])); |
||
31 | } |
||
32 | |||
33 | if (!empty($authDetailsData['CapturedAmount'])) { |
||
34 | $authorizationDetails->setAuthorizationAmount($this->convertPriceToTransfer($authDetailsData['CapturedAmount'])); |
||
35 | } |
||
36 | |||
37 | if (!empty($authDetailsData['AuthorizationFee'])) { |
||
38 | $authorizationDetails->setAuthorizationAmount($this->convertPriceToTransfer($authDetailsData['AuthorizationFee'])); |
||
39 | } |
||
40 | |||
41 | if (!empty($authDetailsData['AuthorizationStatus'])) { |
||
42 | $authorizationDetails->setAuthorizationStatus( |
||
43 | $this->convertStatusToTransfer($authDetailsData['AuthorizationStatus']) |
||
44 | ); |
||
45 | } |
||
46 | |||
47 | if (!empty($authDetailsData['ExpirationTimestamp'])) { |
||
48 | $authorizationDetails->setExpirationTimestamp($authDetailsData['ExpirationTimestamp']); |
||
49 | } |
||
50 | |||
51 | if (!empty($authDetailsData['IdList'])) { |
||
52 | $authorizationDetails->setIdList(array_values($authDetailsData['IdList'])[0]); |
||
53 | } |
||
54 | |||
55 | if (!empty($authDetailsData['SoftDecline'])) { |
||
56 | $authorizationDetails->setSoftDecline($authDetailsData['SoftDecline']); |
||
57 | } |
||
58 | |||
59 | if (!empty($authDetailsData['CaptureNow'])) { |
||
60 | $authorizationDetails->setCaptureNow($authDetailsData['CaptureNow']); |
||
61 | } |
||
62 | |||
63 | if (!empty($authDetailsData['SellerAuthorizationNote'])) { |
||
64 | $authorizationDetails->setSellerAuthorizationNote($authDetailsData['CaptureNow']); |
||
65 | } |
||
66 | |||
67 | if (!empty($authDetailsData['CreationTimestamp'])) { |
||
68 | $authorizationDetails->setCreationTimestamp($authDetailsData['CreationTimestamp']); |
||
69 | } |
||
70 | |||
71 | return $authorizationDetails; |
||
72 | } |
||
75 |
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