Skip to content

Commit 8da2535

Browse files
committed
[10.x] rector-fix
1 parent 3a7c217 commit 8da2535

File tree

8 files changed

+54
-54
lines changed

8 files changed

+54
-54
lines changed

tests/Units/Domain/DiscountTaxTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function testPay(): void
3333
$fee = (int) app(TaxServiceInterface::class)->getFee($product, $product->getAmountProduct($buyer));
3434
$buyer->deposit($product->getAmountProduct($buyer) + $fee);
3535

36-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer) + $fee);
36+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer) + $fee);
3737
$transfer = $buyer->pay($product);
3838
self::assertNotNull($transfer);
3939
self::assertSame(Transfer::STATUS_PAID, $transfer->status);
@@ -42,7 +42,7 @@ public function testPay(): void
4242

4343
self::assertSame((int) $transfer->discount, $product->getPersonalDiscount($buyer));
4444

45-
self::assertSame((int) $transfer->fee, (int) $fee);
45+
self::assertSame((int) $transfer->fee, $fee);
4646

4747
$withdraw = $transfer->withdraw;
4848
$deposit = $transfer->deposit;
@@ -86,12 +86,12 @@ public function testRefundPersonalDiscountAndTax(): void
8686

8787
self::assertSame((int) $transfer->discount, $product->getPersonalDiscount($buyer));
8888

89-
self::assertSame((int) $transfer->fee, (int) $fee);
89+
self::assertSame((int) $transfer->fee, $fee);
9090

9191
self::assertTrue($buyer->refund($product));
9292
self::assertSame(
9393
$buyer->balanceInt,
94-
(int) $product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
94+
$product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
9595
);
9696

9797
self::assertSame($product->balanceInt, 0);
@@ -102,7 +102,7 @@ public function testRefundPersonalDiscountAndTax(): void
102102
self::assertFalse($buyer->safeRefund($product));
103103
self::assertSame(
104104
$buyer->balanceInt,
105-
(int) $product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
105+
$product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
106106
);
107107

108108
self::assertNull($buyer->safePay($product));
@@ -112,15 +112,15 @@ public function testRefundPersonalDiscountAndTax(): void
112112
self::assertSame(0, $buyer->balanceInt);
113113
self::assertSame(
114114
$product->balanceInt,
115-
(int) $product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
115+
$product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
116116
);
117117

118118
self::assertSame($transfer->status, Transfer::STATUS_PAID);
119119

120120
self::assertTrue($buyer->refund($product));
121121
self::assertSame(
122122
$buyer->balanceInt,
123-
(int) $product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
123+
$product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
124124
);
125125

126126
self::assertSame($product->balanceInt, 0);
@@ -142,16 +142,16 @@ public function testForceRefund(): void
142142
$buyer->deposit($product->getAmountProduct($buyer) + $fee - $discount);
143143

144144
$paidPrice = $buyer->balance;
145-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer) + $fee - $discount);
145+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer) + $fee - $discount);
146146

147147
$transfer = $buyer->pay($product);
148148
self::assertSame(0, $buyer->balanceInt);
149149

150-
self::assertSame($product->balanceInt, (int) -$transfer->withdraw->amountInt - $fee);
150+
self::assertSame($product->balanceInt, -$transfer->withdraw->amountInt - $fee);
151151

152152
self::assertSame((int) $transfer->discount, $product->getPersonalDiscount($buyer));
153153

154-
self::assertSame((int) $transfer->fee, (int) $fee);
154+
self::assertSame((int) $transfer->fee, $fee);
155155

156156
$product->withdraw($product->balance);
157157
self::assertSame($product->balanceInt, 0);
@@ -162,7 +162,7 @@ public function testForceRefund(): void
162162
self::assertSame((int) $paidPrice - $fee, -$product->balanceInt);
163163
self::assertSame(
164164
$product->balanceInt,
165-
(int) -($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
165+
-($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
166166
);
167167

168168
self::assertSame((int) $paidPrice - $fee, $buyer->balanceInt);
@@ -207,7 +207,7 @@ public function testForcePay(): void
207207
$fee = (int) app(TaxServiceInterface::class)->getFee($product, $product->getAmountProduct($buyer));
208208
self::assertSame(
209209
$buyer->balanceInt,
210-
(int) -($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)) - $fee
210+
-($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)) - $fee
211211
);
212212

213213
$buyer->deposit(-$buyer->balanceInt);

tests/Units/Domain/DiscountTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testPay(): void
3030
self::assertSame(0, $buyer->balanceInt);
3131
$buyer->deposit($product->getAmountProduct($buyer));
3232

33-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
33+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
3434
$transfer = $buyer->pay($product);
3535
self::assertNotNull($transfer);
3636
self::assertSame(Transfer::STATUS_PAID, $transfer->status);
@@ -72,7 +72,7 @@ public function testItemTransactions(): void
7272
self::assertSame(0, $buyer->balanceInt);
7373
$buyer->deposit($product->getAmountProduct($buyer));
7474

75-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
75+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
7676
$transfer = $buyer->pay($product);
7777
self::assertNotNull($transfer);
7878
self::assertSame(Transfer::STATUS_PAID, $transfer->status);
@@ -109,35 +109,35 @@ public function testRefund(): void
109109
self::assertSame(0, $buyer->balanceInt);
110110
$buyer->deposit($product->getAmountProduct($buyer));
111111

112-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
112+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
113113
$transfer = $buyer->pay($product);
114114
self::assertNotNull($transfer);
115115
self::assertSame(Transfer::STATUS_PAID, $transfer->status);
116116

117117
self::assertSame((int) $transfer->discount, $product->getPersonalDiscount($buyer));
118118

119119
self::assertTrue($buyer->refund($product));
120-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
120+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
121121
self::assertSame(0, $product->balanceInt);
122122

123123
$transfer->refresh();
124124
self::assertSame(Transfer::STATUS_REFUND, $transfer->status);
125125

126126
self::assertFalse($buyer->safeRefund($product));
127-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
127+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
128128

129129
$transfer = $buyer->pay($product);
130130
self::assertNotNull($transfer);
131131
self::assertSame($buyer->balanceInt, $product->getPersonalDiscount($buyer));
132132
self::assertSame(
133133
$product->balanceInt,
134-
(int) ($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
134+
$product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
135135
);
136136

137137
self::assertSame(Transfer::STATUS_PAID, $transfer->status);
138138

139139
self::assertTrue($buyer->refund($product));
140-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
140+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
141141
self::assertSame(0, $product->balanceInt);
142142

143143
$transfer->refresh();
@@ -156,14 +156,14 @@ public function testForceRefund(): void
156156
self::assertSame(0, $buyer->balanceInt);
157157
$buyer->deposit($product->getAmountProduct($buyer));
158158

159-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
159+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
160160

161161
$transfer = $buyer->pay($product);
162162
self::assertSame($buyer->balanceInt, $product->getPersonalDiscount($buyer));
163163

164164
self::assertSame(
165165
$product->balanceInt,
166-
(int) ($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
166+
$product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer)
167167
);
168168

169169
self::assertSame((int) $transfer->discount, $product->getPersonalDiscount($buyer));
@@ -176,10 +176,10 @@ public function testForceRefund(): void
176176

177177
self::assertSame(
178178
$product->balanceInt,
179-
(int) -($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
179+
-($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
180180
);
181181

182-
self::assertSame($buyer->balanceInt, (int) $product->getAmountProduct($buyer));
182+
self::assertSame($buyer->balanceInt, $product->getAmountProduct($buyer));
183183
$product->deposit(-$product->balanceInt);
184184
$buyer->withdraw($buyer->balance);
185185

@@ -219,7 +219,7 @@ public function testForcePay(): void
219219

220220
self::assertSame(
221221
$buyer->balanceInt,
222-
(int) -($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
222+
-($product->getAmountProduct($buyer) - $product->getPersonalDiscount($buyer))
223223
);
224224

225225
$buyer->deposit(-$buyer->balanceInt);

tests/Units/Domain/GiftDiscountTaxTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public function testGift(): void
3838
);
3939

4040
$first->deposit($product->getAmountProduct($first) + $fee);
41-
self::assertSame($first->balanceInt, (int) ($product->getAmountProduct($first) + $fee));
41+
self::assertSame($first->balanceInt, $product->getAmountProduct($first) + $fee);
4242

4343
$transfer = $first->wallet->gift($second, $product);
44-
self::assertSame($first->balanceInt, (int) $product->getPersonalDiscount($first));
44+
self::assertSame($first->balanceInt, $product->getPersonalDiscount($first));
4545
self::assertSame($second->balanceInt, 0);
4646
self::assertNull($first->paid($product, true));
4747
self::assertNotNull($second->paid($product, true));
@@ -71,7 +71,7 @@ public function testRefund(): void
7171
);
7272

7373
$first->deposit($product->getAmountProduct($first) + $fee);
74-
self::assertSame($first->balanceInt, (int) $product->getAmountProduct($first) + $fee);
74+
self::assertSame($first->balanceInt, $product->getAmountProduct($first) + $fee);
7575

7676
$transfer = $first->wallet->gift($second, $product);
7777
self::assertSame($first->balance, (string) $product->getPersonalDiscount($first));
@@ -86,7 +86,7 @@ public function testRefund(): void
8686

8787
self::assertSame(
8888
$first->balanceInt,
89-
(int) ($product->getAmountProduct($first) - $product->getPersonalDiscount($first))
89+
$product->getAmountProduct($first) - $product->getPersonalDiscount($first)
9090
);
9191

9292
$first->withdraw($first->balance);
@@ -97,7 +97,7 @@ public function testRefund(): void
9797

9898
$secondFee = (int) app(TaxServiceInterface::class)->getFee(
9999
$product,
100-
(int) ($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
100+
$product->getAmountProduct($second) - $product->getPersonalDiscount($second)
101101
);
102102

103103
$transfer = $second->wallet->forceGift($first, $product);
@@ -106,7 +106,7 @@ public function testRefund(): void
106106

107107
self::assertSame(
108108
$second->balanceInt,
109-
(int) -(($product->getAmountProduct($second) + $secondFee) - $product->getPersonalDiscount($second))
109+
-(($product->getAmountProduct($second) + $secondFee) - $product->getPersonalDiscount($second))
110110
);
111111

112112
$second->deposit(-$second->balanceInt);
@@ -123,7 +123,7 @@ public function testRefund(): void
123123

124124
self::assertSame(
125125
$product->balanceInt,
126-
(int) -($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
126+
-($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
127127
);
128128

129129
self::assertSame(

tests/Units/Domain/GiftDiscountTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testGift(): void
3434
$first->deposit($product->getAmountProduct($first) - $product->getPersonalDiscount($first));
3535
self::assertSame(
3636
$first->balanceInt,
37-
(int) ($product->getAmountProduct($first) - $product->getPersonalDiscount($first))
37+
$product->getAmountProduct($first) - $product->getPersonalDiscount($first)
3838
);
3939

4040
$transfer = $first->wallet->gift($second, $product);
@@ -63,7 +63,7 @@ public function testRefund(): void
6363
self::assertSame($second->balanceInt, 0);
6464

6565
$first->deposit($product->getAmountProduct($first));
66-
self::assertSame($first->balanceInt, (int) $product->getAmountProduct($first));
66+
self::assertSame($first->balanceInt, $product->getAmountProduct($first));
6767

6868
$transfer = $first->wallet->gift($second, $product);
6969
self::assertGreaterThan(0, $first->balance);
@@ -85,7 +85,7 @@ public function testRefund(): void
8585

8686
self::assertSame(
8787
$second->balanceInt,
88-
(int) -($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
88+
-($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
8989
);
9090

9191
$second->deposit(-$second->balanceInt);
@@ -101,12 +101,12 @@ public function testRefund(): void
101101
self::assertTrue($first->forceRefundGift($product));
102102
self::assertSame(
103103
$product->balanceInt,
104-
(int) -($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
104+
-($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
105105
);
106106

107107
self::assertSame(
108108
$second->balanceInt,
109-
(int) ($product->getAmountProduct($second) - $product->getPersonalDiscount($second))
109+
$product->getAmountProduct($second) - $product->getPersonalDiscount($second)
110110
);
111111

112112
$second->withdraw($second->balance);

tests/Units/Domain/MinTaxTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public function testPayMinimalTax(): void
2828

2929
$fee = (int) ($product->getAmountProduct($buyer) * $product->getFeePercent() / 100);
3030
if ($fee < $product->getMinimalFee()) {
31-
$fee = (int) $product->getMinimalFee();
31+
$fee = $product->getMinimalFee();
3232
}
3333

34-
$balance = (int) ($product->getAmountProduct($buyer) + $fee);
34+
$balance = $product->getAmountProduct($buyer) + $fee;
3535

3636
self::assertSame(0, $buyer->balanceInt);
3737
$buyer->deposit($balance);
@@ -44,7 +44,7 @@ public function testPayMinimalTax(): void
4444
$deposit = $transfer->deposit;
4545

4646
self::assertSame($withdraw->amountInt, -$balance);
47-
self::assertSame($deposit->amountInt, (int) $product->getAmountProduct($buyer));
47+
self::assertSame($deposit->amountInt, $product->getAmountProduct($buyer));
4848
self::assertNotSame($deposit->amountInt, $withdraw->amountInt);
4949
self::assertSame((int) $transfer->fee, $fee);
5050

@@ -68,10 +68,10 @@ public function testPayMaximalTax(): void
6868

6969
$fee = (int) ($product->getAmountProduct($buyer) * $product->getFeePercent() / 100);
7070
if ($fee > $product->getMaximalFee()) {
71-
$fee = (int) $product->getMaximalFee();
71+
$fee = $product->getMaximalFee();
7272
}
7373

74-
$balance = (int) ($product->getAmountProduct($buyer) + $fee);
74+
$balance = $product->getAmountProduct($buyer) + $fee;
7575

7676
self::assertSame(0, $buyer->balanceInt);
7777
$buyer->deposit($balance);
@@ -84,7 +84,7 @@ public function testPayMaximalTax(): void
8484
$deposit = $transfer->deposit;
8585

8686
self::assertSame($withdraw->amountInt, -$balance);
87-
self::assertSame($deposit->amountInt, (int) $product->getAmountProduct($buyer));
87+
self::assertSame($deposit->amountInt, $product->getAmountProduct($buyer));
8888
self::assertNotSame($deposit->amountInt, $withdraw->amountInt);
8989
self::assertSame((int) $transfer->fee, $fee);
9090

tests/Units/Domain/MultiWalletGiftTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testGiftWalletToUser(): void
4141
$item = ItemFactory::new()->create();
4242
$transaction = $wallet->deposit($item->getAmountProduct($wallet));
4343
self::assertSame($transaction->amountInt, $wallet->balanceInt);
44-
self::assertSame((int) $item->getAmountProduct($wallet), $wallet->balanceInt);
44+
self::assertSame($item->getAmountProduct($wallet), $wallet->balanceInt);
4545
self::assertNotNull($transaction);
4646

4747
$transfer = $wallet->gift($second, $item);

0 commit comments

Comments
 (0)