Skip to content

Commit e8cf7e6

Browse files
committed
Run pint
1 parent ea319cb commit e8cf7e6

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

src/Interfaces/WalletOperations.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ public function hasSufficientBalance(int|float $value): bool;
2525
/**
2626
* Pay the order value from the user's wallets.
2727
*
28-
* @param int|float $orderValue
29-
* @param ?string $notes
28+
* @param ?string $notes
29+
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
3030
*
3131
* @throws InsufficientBalanceException
32-
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
3332
*/
3433
public function pay(int|float $orderValue, ?string $notes = null): \Illuminate\Support\Collection;
3534

@@ -42,4 +41,4 @@ public function deposit(string $type, int|float $amount, ?string $notes = null):
4241
* Get user's wallet balance.
4342
*/
4443
public function getWalletBalance(): int|float;
45-
}
44+
}

src/Services/PocketServices.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ public function deposit(WalletOperations $user, string $type, int|float $amount,
1919
/**
2020
* Pay the order value from the user's wallets.
2121
*
22-
* @param WalletOperations $user
23-
* @param int|float $orderValue
24-
* @param ?string $notes
22+
* @param ?string $notes
23+
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
2524
*
2625
* @throws InsufficientBalanceException
27-
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
2826
*/
2927
public function pay(WalletOperations $user, int|float $orderValue, ?string $notes = null): \Illuminate\Support\Collection
3028
{
@@ -46,4 +44,4 @@ public function walletBalanceByType(WalletOperations $user, string $type): int|f
4644
{
4745
return $user->getWalletBalanceByType($type);
4846
}
49-
}
47+
}

src/Traits/HandlesDeposit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function deposit(string $type, int|float $amount, ?string $notes = null):
2121
{
2222
$depositable = $this->getDepositableTypes();
2323

24-
if (!$this->isRequestValid($type, $depositable)) {
24+
if (! $this->isRequestValid($type, $depositable)) {
2525
throw new InvalidDepositException('Invalid deposit request.');
2626
}
2727

@@ -58,10 +58,10 @@ private function getDepositableTypes(): array
5858
*/
5959
private function isRequestValid($type, array $depositable): bool
6060
{
61-
if (!array_key_exists($type, $depositable)) {
61+
if (! array_key_exists($type, $depositable)) {
6262
throw new InvalidWalletTypeException('Invalid deposit type.');
6363
}
6464

6565
return true;
6666
}
67-
}
67+
}

src/Traits/HandlesPayment.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ trait HandlesPayment
1111
/**
1212
* Pay the order value from the user's wallets.
1313
*
14-
* @param int|float $orderValue
15-
* @param ?string $notes
14+
* @param ?string $notes
15+
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
1616
*
1717
* @throws InsufficientBalanceException
18-
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
1918
*/
2019
public function pay(int|float $orderValue, ?string $notes = null): \Illuminate\Database\Eloquent\Collection
2120
{
22-
if (!$this->hasSufficientBalance($orderValue)) {
21+
if (! $this->hasSufficientBalance($orderValue)) {
2322
throw new InsufficientBalanceException('Insufficient balance to cover the order.');
2423
}
2524

@@ -34,7 +33,7 @@ public function pay(int|float $orderValue, ?string $notes = null): \Illuminate\D
3433
$logs = (new WalletsLog())->newCollection();
3534

3635
foreach ($walletsInOrder as $wallet) {
37-
if (!$wallet || !$wallet->hasBalance()) {
36+
if (! $wallet || ! $wallet->hasBalance()) {
3837
continue;
3938
}
4039

@@ -54,4 +53,4 @@ public function pay(int|float $orderValue, ?string $notes = null): \Illuminate\D
5453
return $logs;
5554
});
5655
}
57-
}
56+
}

0 commit comments

Comments
 (0)