Skip to content

Commit ea319cb

Browse files
committed
Fix missing types
1 parent 1a461c8 commit ea319cb

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

src/Interfaces/WalletOperations.php

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

src/Services/PocketServices.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ public function deposit(WalletOperations $user, string $type, int|float $amount,
1919
/**
2020
* Pay the order value from the user's wallets.
2121
*
22-
* @param ?string $notes
23-
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
22+
* @param WalletOperations $user
23+
* @param int|float $orderValue
24+
* @param ?string $notes
2425
*
2526
* @throws InsufficientBalanceException
27+
* @return \Illuminate\Support\Collection<TKey,WalletsLog>
2628
*/
2729
public function pay(WalletOperations $user, int|float $orderValue, ?string $notes = null): \Illuminate\Support\Collection
2830
{

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

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

3536
foreach ($walletsInOrder as $wallet) {
36-
if (! $wallet || ! $wallet->hasBalance()) {
37+
if (!$wallet || !$wallet->hasBalance()) {
3738
continue;
3839
}
3940

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

0 commit comments

Comments
 (0)