Skip to content

Commit 7df571e

Browse files
Added type declarations for set parameters
1 parent 2c79b49 commit 7df571e

File tree

9 files changed

+98
-66
lines changed

9 files changed

+98
-66
lines changed

src/Concerns/Parameters.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ public function getAccessKey(): ?string
2727
* Thiết lập access key do MoMo cấp.
2828
*
2929
* @param string $key
30+
* @return self
3031
*/
31-
public function setAccessKey(string $key): void
32+
public function setAccessKey(string $key): self
3233
{
33-
$this->setParameter('accessKey', $key);
34+
return $this->setParameter('accessKey', $key);
3435
}
3536

3637
/**
@@ -47,10 +48,11 @@ public function getSecretKey(): ?string
4748
* Thiết lập secret key do MoMo cấp.
4849
*
4950
* @param string $key
51+
* @return self
5052
*/
51-
public function setSecretKey(string $key): void
53+
public function setSecretKey(string $key): self
5254
{
53-
$this->setParameter('secretKey', $key);
55+
return $this->setParameter('secretKey', $key);
5456
}
5557

5658
/**
@@ -67,10 +69,11 @@ public function getPartnerCode(): ?string
6769
* Thiết lập partner code do MoMo cấp.
6870
*
6971
* @param string $code
72+
* @return self
7073
*/
71-
public function setPartnerCode(string $code): void
74+
public function setPartnerCode(string $code): self
7275
{
73-
$this->setParameter('partnerCode', $code);
76+
return $this->setParameter('partnerCode', $code);
7477
}
7578

7679
/**
@@ -87,9 +90,10 @@ public function getPublicKey(): ?string
8790
* Thiết lập public key do MoMo cấp.
8891
*
8992
* @param string $key
93+
* @return self
9094
*/
91-
public function setPublicKey(string $key): void
95+
public function setPublicKey(string $key): self
9296
{
93-
$this->setParameter('publicKey', $key);
97+
return $this->setParameter('publicKey', $key);
9498
}
9599
}

src/Message/AllInOne/AbstractSignatureRequest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ public function getOrderId(): ?string
3636
* Thiết lập id đơn hàng.
3737
*
3838
* @param string $id
39+
* @return self
3940
*/
40-
public function setOrderId(string $id): void
41+
public function setOrderId(string $id): self
4142
{
42-
$this->setParameter('orderId', $id);
43+
return $this->setParameter('orderId', $id);
4344
}
4445

4546
/**
@@ -56,10 +57,11 @@ public function getRequestId(): ?string
5657
* Thiết lập request id của đơn hàng.
5758
*
5859
* @param string $id
60+
* @return self
5961
*/
60-
public function setRequestId(string $id): void
62+
public function setRequestId(string $id): self
6163
{
62-
$this->setParameter('requestId', $id);
64+
return $this->setParameter('requestId', $id);
6365
}
6466

6567
/**

src/Message/AllInOne/PurchaseRequest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ public function getExtraData(): ?string
3434
* Thiết lập dữ liệu kèm theo đơn hàng.
3535
*
3636
* @param string $data
37+
* @return self
3738
*/
38-
public function setExtraData(string $data): void
39+
public function setExtraData(string $data): self
3940
{
40-
$this->setParameter('extraData', $data);
41+
return $this->setParameter('extraData', $data);
4142
}
4243

4344
/**
@@ -54,10 +55,11 @@ public function getOrderInfo(): ?string
5455
* Thiết lập thông tin đơn hàng.
5556
*
5657
* @param string $info
58+
* @return self
5759
*/
58-
public function setOrderInfo(string $info): void
60+
public function setOrderInfo(string $info): self
5961
{
60-
$this->setParameter('orderInfo', $info);
62+
return $this->setParameter('orderInfo', $info);
6163
}
6264

6365
/**

src/Message/AllInOne/RefundRequest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ public function getTransactionId(): ?string
3131
/**
3232
* {@inheritdoc}
3333
*/
34-
public function setTransactionId($value): void
34+
public function setTransactionId($value): self
3535
{
36-
$this->setTransId($value);
36+
return $this->setTransId($value);
3737
}
3838

3939
/**
@@ -50,10 +50,11 @@ public function getTransId(): ?string
5050
* Thiết lập mã giao dịch của MoMo.
5151
*
5252
* @param string $id
53+
* @return self
5354
*/
54-
public function setTransId(string $id): void
55+
public function setTransId(string $id): self
5556
{
56-
$this->setParameter('transId', $id);
57+
return $this->setParameter('transId', $id);
5758
}
5859

5960
/**

src/Message/AppInApp/PurchaseRequest.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ public function getAppData(): ?string
5454
* Thiết app token từ app MoMo gửi sang.
5555
*
5656
* @param string $appData
57+
* @return self
5758
*/
58-
public function setAppData(string $appData): void
59+
public function setAppData(string $appData): self
5960
{
60-
$this->setParameter('appData', $appData);
61+
return $this->setParameter('appData', $appData);
6162
}
6263

6364
/**
@@ -74,10 +75,11 @@ public function getStoreId(): ?string
7475
* Thiết lập mã cửa hàng.
7576
*
7677
* @param string $id
78+
* @return self
7779
*/
78-
public function setStoreId(string $id): void
80+
public function setStoreId(string $id): self
7981
{
80-
$this->setParameter('storeId', $id);
82+
return $this->setParameter('storeId', $id);
8183
}
8284

8385
/**
@@ -94,10 +96,11 @@ public function getStoreName(): ?string
9496
* Thiết lập tên cửa hàng.
9597
*
9698
* @param string $name
99+
* @return self
97100
*/
98-
public function setStoreName(string $name): void
101+
public function setStoreName(string $name): self
99102
{
100-
$this->setParameter('storeName', $name);
103+
return $this->setParameter('storeName', $name);
101104
}
102105

103106
/**
@@ -114,10 +117,11 @@ public function getPartnerRefId(): ?string
114117
* Thiết lập mã đơn hàng.
115118
*
116119
* @param string $id
120+
* @return self
117121
*/
118-
public function setPartnerRefId(string $id): void
122+
public function setPartnerRefId(string $id): self
119123
{
120-
$this->setParameter('partnerRefId', $id);
124+
return $this->setParameter('partnerRefId', $id);
121125
}
122126

123127
/**
@@ -134,10 +138,11 @@ public function getPartnerTransId(): ?string
134138
* Thiết lập mã đơn hàng bổ sung.
135139
*
136140
* @param string $id
141+
* @return self
137142
*/
138-
public function setPartnerTransId(string $id): void
143+
public function setPartnerTransId(string $id): self
139144
{
140-
$this->setParameter('partnerTransId', $id);
145+
return $this->setParameter('partnerTransId', $id);
141146
}
142147

143148
/**
@@ -154,10 +159,11 @@ public function getPartnerName(): ?string
154159
* Thiết lập tên công ty, tổ chức của bạn.
155160
*
156161
* @param string $name
162+
* @return self
157163
*/
158-
public function setPartnerName(string $name): void
164+
public function setPartnerName(string $name): self
159165
{
160-
$this->setParameter('partnerName', $name);
166+
return $this->setParameter('partnerName', $name);
161167
}
162168

163169
/**
@@ -174,10 +180,11 @@ public function getCustomerNumber(): ?string
174180
* Thiết lập số điện thoại khách hàng.
175181
*
176182
* @param string $number
183+
* @return self
177184
*/
178-
public function setCustomerNumber(string $number): void
185+
public function setCustomerNumber(string $number): self
179186
{
180-
$this->setParameter('customerNumber', $number);
187+
return $this->setParameter('customerNumber', $number);
181188
}
182189

183190
/**

src/Message/POS/PurchaseRequest.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ public function getStoreId(): ?string
5757
* Thiết lập mã cửa hàng.
5858
*
5959
* @param string $id
60+
* @return self
6061
*/
61-
public function setStoreId(string $id): void
62+
public function setStoreId(string $id): self
6263
{
63-
$this->setParameter('storeId', $id);
64+
return $this->setParameter('storeId', $id);
6465
}
6566

6667
/**
@@ -77,10 +78,11 @@ public function getStoreName(): ?string
7778
* Thiết lập tên cửa hàng.
7879
*
7980
* @param string $name
81+
* @return self
8082
*/
81-
public function setStoreName(string $name): void
83+
public function setStoreName(string $name): self
8284
{
83-
$this->setParameter('storeName', $name);
85+
return $this->setParameter('storeName', $name);
8486
}
8587

8688
/**
@@ -97,10 +99,11 @@ public function getPartnerRefId(): ?string
9799
* Thiết lập mã đơn hàng.
98100
*
99101
* @param string $id
102+
* @return self
100103
*/
101-
public function setPartnerRefId(string $id): void
104+
public function setPartnerRefId(string $id): self
102105
{
103-
$this->setParameter('partnerRefId', $id);
106+
return $this->setParameter('partnerRefId', $id);
104107
}
105108

106109
/**
@@ -117,10 +120,11 @@ public function getPaymentCode(): ?string
117120
* Thiết lập mã khách thanh toán.
118121
*
119122
* @param string $code
123+
* @return self
120124
*/
121-
public function setPaymentCode(string $code): void
125+
public function setPaymentCode(string $code): self
122126
{
123-
$this->setParameter('paymentCode', $code);
127+
return $this->setParameter('paymentCode', $code);
124128
}
125129

126130
/**

src/Message/PayConfirmRequest.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ public function getRequestId(): ?string
4545
* Thiết lập request id của đơn hàng.
4646
*
4747
* @param string $id
48+
* @return self
4849
*/
49-
public function setRequestId(string $id): void
50+
public function setRequestId(string $id): self
5051
{
51-
$this->setParameter('requestId', $id);
52+
return $this->setParameter('requestId', $id);
5253
}
5354

5455
/**
@@ -65,10 +66,11 @@ public function getPartnerRefId(): ?string
6566
* Thiết lập mã đơn hàng.
6667
*
6768
* @param string $id
69+
* @return self
6870
*/
69-
public function setPartnerRefId(string $id): void
71+
public function setPartnerRefId(string $id): self
7072
{
71-
$this->setParameter('partnerRefId', $id);
73+
return $this->setParameter('partnerRefId', $id);
7274
}
7375

7476
/**
@@ -85,10 +87,11 @@ public function getMomoTransId(): ?string
8587
* Thiết lập mã giao dịch của MoMo.
8688
*
8789
* @param string $id
90+
* @return self
8891
*/
89-
public function setMomoTransId(string $id): void
92+
public function setMomoTransId(string $id): self
9093
{
91-
$this->setParameter('momoTransId', $id);
94+
return $this->setParameter('momoTransId', $id);
9295
}
9396

9497
/**
@@ -105,10 +108,11 @@ public function getCustomerNumber(): ?string
105108
* Thiết lập số điện thoại khách hàng.
106109
*
107110
* @param string $number
111+
* @return self
108112
*/
109-
public function setCustomerNumber(string $number): void
113+
public function setCustomerNumber(string $number): self
110114
{
111-
$this->setParameter('customerNumber', $number);
115+
return $this->setParameter('customerNumber', $number);
112116
}
113117

114118
/**
@@ -125,10 +129,11 @@ public function getRequestType(): ?string
125129
* Thiết lập loại request type yêu cầu MoMo, commit hoặc rollback.
126130
*
127131
* @param string $type
132+
* @return self
128133
*/
129-
public function setRequestType(string $type): void
134+
public function setRequestType(string $type): self
130135
{
131-
$this->setParameter('requestType', $type);
136+
return $this->setParameter('requestType', $type);
132137
}
133138

134139
/**

0 commit comments

Comments
 (0)