|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* MIT License |
|
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\Braintree\Persistence\Mapper; |
|
9
|
|
|
|
|
10
|
|
|
use Generated\Shared\Transfer\PaymentBraintreeTransactionRequestLogTransfer; |
|
|
|
|
|
|
11
|
|
|
use Generated\Shared\Transfer\PaymentBraintreeTransactionStatusLogTransfer; |
|
|
|
|
|
|
12
|
|
|
use Generated\Shared\Transfer\PaymentBraintreeTransfer; |
|
|
|
|
|
|
13
|
|
|
use Orm\Zed\Braintree\Persistence\SpyPaymentBraintree; |
|
|
|
|
|
|
14
|
|
|
use Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionRequestLog; |
|
|
|
|
|
|
15
|
|
|
use Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLog; |
|
|
|
|
|
|
16
|
|
|
|
|
17
|
|
|
class BraintreePersistenceMapper implements BraintreePersistenceMapperInterface |
|
18
|
|
|
{ |
|
19
|
|
|
/** |
|
20
|
|
|
* @param \Generated\Shared\Transfer\PaymentBraintreeTransfer $paymentBraintreeTransfer |
|
21
|
|
|
* @param \Orm\Zed\Braintree\Persistence\SpyPaymentBraintree $paymentBraintreeEntity |
|
22
|
|
|
* |
|
23
|
|
|
* @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintree |
|
24
|
|
|
*/ |
|
25
|
|
|
public function mapPaymentBraintreeTransferToEntity( |
|
26
|
|
|
PaymentBraintreeTransfer $paymentBraintreeTransfer, |
|
27
|
|
|
SpyPaymentBraintree $paymentBraintreeEntity |
|
28
|
|
|
): SpyPaymentBraintree { |
|
29
|
|
|
$paymentBraintreeEntity->fromArray($paymentBraintreeTransfer->modifiedToArray()); |
|
30
|
|
|
$paymentBraintreeEntity->setNew($paymentBraintreeTransfer->getIdPaymentBraintree() === null); |
|
31
|
|
|
|
|
32
|
|
|
return $paymentBraintreeEntity; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @param \Orm\Zed\Braintree\Persistence\SpyPaymentBraintree $paymentBraintreeEntity |
|
37
|
|
|
* @param \Generated\Shared\Transfer\PaymentBraintreeTransfer $paymentBraintreeTransfer |
|
38
|
|
|
* |
|
39
|
|
|
* @return \Generated\Shared\Transfer\PaymentBraintreeTransfer |
|
40
|
|
|
*/ |
|
41
|
|
|
public function mapEntityToPaymentBraintreeTransfer( |
|
42
|
|
|
SpyPaymentBraintree $paymentBraintreeEntity, |
|
43
|
|
|
PaymentBraintreeTransfer $paymentBraintreeTransfer |
|
44
|
|
|
): PaymentBraintreeTransfer { |
|
45
|
|
|
return $paymentBraintreeTransfer->fromArray($paymentBraintreeEntity->toArray(), true); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @param \Generated\Shared\Transfer\PaymentBraintreeTransactionStatusLogTransfer $paymentBraintreeTransactionStatusLogTransfer |
|
50
|
|
|
* @param \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLog $paymentBraintreeTransactionStatusLogEntity |
|
51
|
|
|
* |
|
52
|
|
|
* @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLog |
|
53
|
|
|
*/ |
|
54
|
|
|
public function mapPaymentBraintreeTransactionStatusLogTransferToEntity( |
|
55
|
|
|
PaymentBraintreeTransactionStatusLogTransfer $paymentBraintreeTransactionStatusLogTransfer, |
|
56
|
|
|
SpyPaymentBraintreeTransactionStatusLog $paymentBraintreeTransactionStatusLogEntity |
|
57
|
|
|
): SpyPaymentBraintreeTransactionStatusLog { |
|
58
|
|
|
$paymentBraintreeTransactionStatusLogEntity->fromArray($paymentBraintreeTransactionStatusLogTransfer->modifiedToArray()); |
|
59
|
|
|
$paymentBraintreeTransactionStatusLogEntity->setNew($paymentBraintreeTransactionStatusLogTransfer->getIdPaymentBraintreeTransactionStatusLog() === null); |
|
60
|
|
|
|
|
61
|
|
|
return $paymentBraintreeTransactionStatusLogEntity; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @param \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionStatusLog $paymentBraintreeTransactionStatusLogEntity |
|
66
|
|
|
* @param \Generated\Shared\Transfer\PaymentBraintreeTransactionStatusLogTransfer $paymentBraintreeTransactionStatusLogTransfer |
|
67
|
|
|
* |
|
68
|
|
|
* @return \Generated\Shared\Transfer\PaymentBraintreeTransactionStatusLogTransfer |
|
69
|
|
|
*/ |
|
70
|
|
|
public function mapEntityToPaymentBraintreeTransactionStatusLogTransfer( |
|
71
|
|
|
SpyPaymentBraintreeTransactionStatusLog $paymentBraintreeTransactionStatusLogEntity, |
|
72
|
|
|
PaymentBraintreeTransactionStatusLogTransfer $paymentBraintreeTransactionStatusLogTransfer |
|
73
|
|
|
): PaymentBraintreeTransactionStatusLogTransfer { |
|
74
|
|
|
return $paymentBraintreeTransactionStatusLogTransfer->fromArray($paymentBraintreeTransactionStatusLogEntity->toArray(), true); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @param \Generated\Shared\Transfer\PaymentBraintreeTransactionRequestLogTransfer $paymentBraintreeTransactionRequestLogTransfer |
|
79
|
|
|
* @param \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionRequestLog $paymentBraintreeTransactionRequestLogEntity |
|
80
|
|
|
* |
|
81
|
|
|
* @return \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionRequestLog |
|
82
|
|
|
*/ |
|
83
|
|
|
public function mapPaymentBraintreeTransactionRequestLogTransferToEntity( |
|
84
|
|
|
PaymentBraintreeTransactionRequestLogTransfer $paymentBraintreeTransactionRequestLogTransfer, |
|
85
|
|
|
SpyPaymentBraintreeTransactionRequestLog $paymentBraintreeTransactionRequestLogEntity |
|
86
|
|
|
): SpyPaymentBraintreeTransactionRequestLog { |
|
87
|
|
|
$paymentBraintreeTransactionRequestLogEntity->fromArray($paymentBraintreeTransactionRequestLogTransfer->modifiedToArray()); |
|
88
|
|
|
$paymentBraintreeTransactionRequestLogEntity->setNew($paymentBraintreeTransactionRequestLogTransfer->getIdPaymentBraintreeTransactionRequestLog() === null); |
|
89
|
|
|
|
|
90
|
|
|
return $paymentBraintreeTransactionRequestLogEntity; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* @param \Orm\Zed\Braintree\Persistence\SpyPaymentBraintreeTransactionRequestLog $paymentBraintreeTransactionRequestLogEntity |
|
95
|
|
|
* @param \Generated\Shared\Transfer\PaymentBraintreeTransactionRequestLogTransfer $paymentBraintreeTransactionRequestLogTransfer |
|
96
|
|
|
* |
|
97
|
|
|
* @return \Generated\Shared\Transfer\PaymentBraintreeTransactionRequestLogTransfer |
|
98
|
|
|
*/ |
|
99
|
|
|
public function mapEntityToPaymentBraintreeTransactionRequestLogTransfer( |
|
100
|
|
|
SpyPaymentBraintreeTransactionRequestLog $paymentBraintreeTransactionRequestLogEntity, |
|
101
|
|
|
PaymentBraintreeTransactionRequestLogTransfer $paymentBraintreeTransactionRequestLogTransfer |
|
102
|
|
|
): PaymentBraintreeTransactionRequestLogTransfer { |
|
103
|
|
|
return $paymentBraintreeTransactionRequestLogTransfer->fromArray($paymentBraintreeTransactionRequestLogEntity->toArray(), true); |
|
104
|
|
|
} |
|
105
|
|
|
} |
|
106
|
|
|
|
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