Skip to content

Commit 3a7c217

Browse files
committed
[10.x] ecs-fix
1 parent 9657638 commit 3a7c217

File tree

12 files changed

+71
-192
lines changed

12 files changed

+71
-192
lines changed

tests/Infra/Services/MyExchangeService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
final class MyExchangeService implements ExchangeServiceInterface
1111
{
12-
/** @var array<string, array<string, int|float|string>> */
12+
/**
13+
* @var array<string, array<string, int|float|string>>
14+
*/
1315
private array $rates = [
1416
'USD' => [
1517
'RUB' => 67.61,

tests/Units/Domain/CartTest.php

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
use Bavix\Wallet\Test\Infra\Models\ItemMeta;
2020
use Bavix\Wallet\Test\Infra\PackageModels\Transaction;
2121
use Bavix\Wallet\Test\Infra\TestCase;
22-
use Illuminate\Database\Eloquent\Collection;
2322
use function count;
23+
use Illuminate\Database\Eloquent\Collection;
2424

2525
/**
2626
* @internal
@@ -52,13 +52,9 @@ public function testCartClone(): void
5252

5353
public function testCartMeta(): void
5454
{
55-
/**
56-
* @var Buyer $buyer
57-
*/
55+
/** @var Buyer $buyer */
5856
$buyer = BuyerFactory::new()->create();
59-
/**
60-
* @var ItemMeta $product
61-
*/
57+
/** @var ItemMeta $product */
6258
$product = ItemMetaFactory::new()->create([
6359
'quantity' => 1,
6460
]);
@@ -98,13 +94,9 @@ public function testCartGetBasketDtoCartEmpty(): void
9894

9995
public function testCartMetaItemNoMeta(): void
10096
{
101-
/**
102-
* @var Buyer $buyer
103-
*/
97+
/** @var Buyer $buyer */
10498
$buyer = BuyerFactory::new()->create();
105-
/**
106-
* @var Item $product
107-
*/
99+
/** @var Item $product */
108100
$product = ItemFactory::new()->create([
109101
'quantity' => 1,
110102
]);
@@ -136,13 +128,9 @@ public function testCartMetaItemNoMeta(): void
136128

137129
public function testPay(): void
138130
{
139-
/**
140-
* @var Buyer $buyer
141-
*/
131+
/** @var Buyer $buyer */
142132
$buyer = BuyerFactory::new()->create();
143-
/**
144-
* @var Collection<int, Item> $products
145-
*/
133+
/** @var Collection<int, Item> $products */
146134
$products = ItemFactory::times(10)->create([
147135
'quantity' => 1,
148136
]);
@@ -181,13 +169,9 @@ public function testPay(): void
181169

182170
public function testCartQuantity(): void
183171
{
184-
/**
185-
* @var Buyer $buyer
186-
*/
172+
/** @var Buyer $buyer */
187173
$buyer = BuyerFactory::new()->create();
188-
/**
189-
* @var Collection<int, Item> $products
190-
*/
174+
/** @var Collection<int, Item> $products */
191175
$products = ItemFactory::times(10)->create([
192176
'quantity' => 10,
193177
]);
@@ -224,9 +208,7 @@ public function testModelNotFoundException(): void
224208
$this->expectExceptionCode(ExceptionInterface::MODEL_NOT_FOUND);
225209
/** @var Buyer $buyer */
226210
$buyer = BuyerFactory::new()->create();
227-
/**
228-
* @var Collection<int, Item> $products
229-
*/
211+
/** @var Collection<int, Item> $products */
230212
$products = ItemFactory::times(10)->create([
231213
'quantity' => 10,
232214
]);
@@ -260,13 +242,9 @@ public function testModelNotFoundException(): void
260242

261243
public function testBoughtGoods(): void
262244
{
263-
/**
264-
* @var Buyer $buyer
265-
*/
245+
/** @var Buyer $buyer */
266246
$buyer = BuyerFactory::new()->create();
267-
/**
268-
* @var Collection<int, Item> $products
269-
*/
247+
/** @var Collection<int, Item> $products */
270248
$products = ItemFactory::times(10)->create([
271249
'quantity' => 10,
272250
]);
@@ -301,13 +279,9 @@ public function testWithdrawal(): void
301279
$transactionLevel = Buyer::query()->getConnection()->transactionLevel();
302280
self::assertSame(0, $transactionLevel);
303281

304-
/**
305-
* @var Buyer $buyer
306-
*/
282+
/** @var Buyer $buyer */
307283
$buyer = BuyerFactory::new()->create();
308-
/**
309-
* @var Item $product
310-
*/
284+
/** @var Item $product */
311285
$product = ItemFactory::new()->create([
312286
'quantity' => 1,
313287
]);

tests/Units/Domain/ConfirmTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,11 @@ public function testTransactionResetConfirmSuccess(): void
304304
});
305305

306306
/** @var string $sum1 */
307-
$sum1 = $user1->transactions()->sum('amount');
307+
$sum1 = $user1->transactions()
308+
->sum('amount');
308309
/** @var string $sum2 */
309-
$sum2 = $user2->transactions()->sum('amount');
310+
$sum2 = $user2->transactions()
311+
->sum('amount');
310312

311313
self::assertSame(500, (int) $sum1);
312314
self::assertSame(500, (int) $sum2);

tests/Units/Domain/DiscountTaxTest.php

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ final class DiscountTaxTest extends TestCase
2424
{
2525
public function testPay(): void
2626
{
27-
/**
28-
* @var Buyer $buyer
29-
*/
27+
/** @var Buyer $buyer */
3028
$buyer = BuyerFactory::new()->create();
31-
/**
32-
* @var ItemDiscountTax $product
33-
*/
29+
/** @var ItemDiscountTax $product */
3430
$product = ItemDiscountTaxFactory::new()->create();
3531

3632
self::assertSame(0, $buyer->balanceInt);
@@ -73,13 +69,9 @@ public function testPay(): void
7369

7470
public function testRefundPersonalDiscountAndTax(): void
7571
{
76-
/**
77-
* @var Buyer $buyer
78-
*/
72+
/** @var Buyer $buyer */
7973
$buyer = BuyerFactory::new()->create();
80-
/**
81-
* @var ItemDiscountTax $product
82-
*/
74+
/** @var ItemDiscountTax $product */
8375
$product = ItemDiscountTaxFactory::new()->create();
8476

8577
self::assertSame($buyer->balanceInt, 0);
@@ -139,13 +131,9 @@ public function testRefundPersonalDiscountAndTax(): void
139131

140132
public function testForceRefund(): void
141133
{
142-
/**
143-
* @var Buyer $buyer
144-
*/
134+
/** @var Buyer $buyer */
145135
$buyer = BuyerFactory::new()->create();
146-
/**
147-
* @var ItemDiscountTax $product
148-
*/
136+
/** @var ItemDiscountTax $product */
149137
$product = ItemDiscountTaxFactory::new()->create();
150138

151139
self::assertSame(0, $buyer->balanceInt);
@@ -191,13 +179,9 @@ public function testOutOfStock(): void
191179
$this->expectExceptionCode(ExceptionInterface::PRODUCT_ENDED);
192180
$this->expectExceptionMessageStrict(trans('wallet::errors.product_stock'));
193181

194-
/**
195-
* @var Buyer $buyer
196-
*/
182+
/** @var Buyer $buyer */
197183
$buyer = BuyerFactory::new()->create();
198-
/**
199-
* @var ItemDiscountTax $product
200-
*/
184+
/** @var ItemDiscountTax $product */
201185
$product = ItemDiscountTaxFactory::new()->create([
202186
'quantity' => 1,
203187
]);
@@ -210,13 +194,9 @@ public function testOutOfStock(): void
210194

211195
public function testForcePay(): void
212196
{
213-
/**
214-
* @var Buyer $buyer
215-
*/
197+
/** @var Buyer $buyer */
216198
$buyer = BuyerFactory::new()->create();
217-
/**
218-
* @var ItemDiscountTax $product
219-
*/
199+
/** @var ItemDiscountTax $product */
220200
$product = ItemDiscountTaxFactory::new()->create([
221201
'quantity' => 1,
222202
]);
@@ -236,13 +216,9 @@ public function testForcePay(): void
236216

237217
public function testPayFreeAndRefund(): void
238218
{
239-
/**
240-
* @var Buyer $buyer
241-
*/
219+
/** @var Buyer $buyer */
242220
$buyer = BuyerFactory::new()->create();
243-
/**
244-
* @var ItemDiscountTax $product
245-
*/
221+
/** @var ItemDiscountTax $product */
246222
$product = ItemDiscountTaxFactory::new()->create([
247223
'quantity' => 1,
248224
]);
@@ -263,13 +239,9 @@ public function testPayFreeAndRefund(): void
263239

264240
public function testFreePay(): void
265241
{
266-
/**
267-
* @var Buyer $buyer
268-
*/
242+
/** @var Buyer $buyer */
269243
$buyer = BuyerFactory::new()->create();
270-
/**
271-
* @var ItemDiscountTax $product
272-
*/
244+
/** @var ItemDiscountTax $product */
273245
$product = ItemDiscountTaxFactory::new()->create([
274246
'quantity' => 1,
275247
]);
@@ -299,13 +271,9 @@ public function testPayFreeOutOfStock(): void
299271
$this->expectExceptionCode(ExceptionInterface::PRODUCT_ENDED);
300272
$this->expectExceptionMessageStrict(trans('wallet::errors.product_stock'));
301273

302-
/**
303-
* @var Buyer $buyer
304-
*/
274+
/** @var Buyer $buyer */
305275
$buyer = BuyerFactory::new()->create();
306-
/**
307-
* @var ItemDiscountTax $product
308-
*/
276+
/** @var ItemDiscountTax $product */
309277
$product = ItemDiscountTaxFactory::new()->create([
310278
'quantity' => 1,
311279
]);

0 commit comments

Comments
 (0)