Skip to content

Commit 309eb3a

Browse files
committed
reformat code
1 parent a0468f8 commit 309eb3a

13 files changed

+82
-85
lines changed

src/Interfaces/Wallet.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ public function getBalanceAttribute(): string;
161161
*/
162162
public function getBalanceIntAttribute(): int;
163163

164-
/**
165-
* Represents a relationship where a wallet has many transactions.
166-
*
167-
* @return HasMany<Transaction> A collection of transactions associated with this wallet.
168-
*/
169-
public function walletTransactions(): HasMany;
164+
/**
165+
* Represents a relationship where a wallet has many transactions.
166+
*
167+
* @return HasMany<Transaction> A collection of transactions associated with this wallet.
168+
*/
169+
public function walletTransactions(): HasMany;
170170

171171
/**
172172
* Returns all the transactions associated with this wallet.

src/Internal/Assembler/TransferLazyDtoAssemblerInterface.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ interface TransferLazyDtoAssemblerInterface
1313
/**
1414
* Create transfer lazy dto.
1515
*
16-
* @param Wallet $fromWallet The source wallet.
17-
* @param Wallet $toWallet The destination wallet.
18-
* @param int $discount The discount amount.
19-
* @param string $fee The fee amount.
20-
* @param TransactionDtoInterface $withdrawDto The withdrawal transaction DTO.
21-
* @param TransactionDtoInterface $depositDto The deposit transaction DTO.
22-
* @param string $status The transfer status.
23-
* @param string|null $uuid The transfer UUID.
24-
* @param array<mixed>|null $extra The extra data.
16+
* @param Wallet $fromWallet The source wallet.
17+
* @param Wallet $toWallet The destination wallet.
18+
* @param int $discount The discount amount.
19+
* @param string $fee The fee amount.
20+
* @param TransactionDtoInterface $withdrawDto The withdrawal transaction DTO.
21+
* @param TransactionDtoInterface $depositDto The deposit transaction DTO.
22+
* @param string $status The transfer status.
23+
* @param string|null $uuid The transfer UUID.
24+
* @param array<mixed>|null $extra The extra data.
2525
* @return TransferLazyDtoInterface The transfer lazy DTO.
2626
*/
2727
public function create(

src/Internal/Repository/TransferRepositoryInterface.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ public function insertOne(TransferDtoInterface $dto): Transfer;
3333
*/
3434
public function findBy(TransferQueryInterface $query): array;
3535

36-
/**
37-
* Updates the status of transfers identified by their IDs.
38-
*
39-
* This method updates the status field of transfers in the repository
40-
* to the provided status, for all transfers whose IDs are included
41-
* in the provided array. The method returns the number of transfers
42-
* that were updated.
43-
*
44-
* @param string $status The new status to set for the specified transfers.
45-
* @param non-empty-array<int> $ids A non-empty array of transfer IDs to update.
46-
* @return int The number of transfers whose status was updated.
47-
*/
48-
public function updateStatusByIds(string $status, array $ids): int;
36+
/**
37+
* Updates the status of transfers identified by their IDs.
38+
*
39+
* This method updates the status field of transfers in the repository
40+
* to the provided status, for all transfers whose IDs are included
41+
* in the provided array. The method returns the number of transfers
42+
* that were updated.
43+
*
44+
* @param string $status The new status to set for the specified transfers.
45+
* @param non-empty-array<int> $ids A non-empty array of transfer IDs to update.
46+
* @return int The number of transfers whose status was updated.
47+
*/
48+
public function updateStatusByIds(string $status, array $ids): int;
4949
}

src/Internal/Service/ConnectionServiceInterface.php

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@
1717
*/
1818
interface ConnectionServiceInterface
1919
{
20-
/**
21-
* Get a database connection instance.
22-
*
23-
* This method returns a database connection instance.
24-
*
25-
* @return ConnectionInterface The database connection instance.
26-
*
27-
* @example
28-
* // Get a database connection instance.
29-
* $connection = $this->get();
30-
*
31-
* // Run a query on the "users" table.
32-
* * $connection->table('users')->where('id', 1)->update(['name' => 'Jane']);
33-
*
34-
* // Start a database transaction.
35-
* $connection->beginTransaction();
36-
*
37-
* try {
38-
* // Run queries...
39-
*
40-
* // Commit the transaction.
41-
* $connection->commit();
42-
* } catch (Exception $e) {
43-
* // Rollback the transaction.
44-
* $connection->rollback();
45-
*
46-
* // Rethrow the exception.
47-
* throw $e;
48-
* }
49-
*/
50-
public function get(): ConnectionInterface;
20+
/**
21+
* Get a database connection instance.
22+
*
23+
* This method returns a database connection instance.
24+
*
25+
* @return ConnectionInterface The database connection instance.
26+
*
27+
* @example
28+
* // Get a database connection instance.
29+
* $connection = $this->get();
30+
*
31+
* // Run a query on the "users" table.
32+
* * $connection->table('users')->where('id', 1)->update(['name' => 'Jane']);
33+
*
34+
* // Start a database transaction.
35+
* $connection->beginTransaction();
36+
*
37+
* try {
38+
* // Run queries...
39+
*
40+
* // Commit the transaction.
41+
* $connection->commit();
42+
* } catch (Exception $e) {
43+
* // Rollback the transaction.
44+
* $connection->rollback();
45+
*
46+
* // Rethrow the exception.
47+
* throw $e;
48+
* }
49+
*/
50+
public function get(): ConnectionInterface;
5151
}

src/Services/AssistantServiceInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function getSums(array $transactions): array;
6767
* relevant details.
6868
*
6969
* @param BasketDtoInterface $basketDto The basket DTO object.
70-
* @param ProductInterface $product The product object.
70+
* @param ProductInterface $product The product object.
7171
* @return array<mixed>|null The meta data for the cart, or null if there is no meta data.
7272
*
7373
* @example

src/Services/BasketService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public function availability(AvailabilityDtoInterface $availabilityDto): bool
1919
foreach ($basketDto->items() as $itemDto) {
2020
$product = $itemDto->getProduct();
2121
if ($product instanceof ProductLimitedInterface && ! $product->canBuy(
22-
$customer,
23-
$itemDto->count(),
24-
$availabilityDto->isForce()
25-
)) {
22+
$customer,
23+
$itemDto->count(),
24+
$availabilityDto->isForce()
25+
)) {
2626
return false;
2727
}
2828
}

src/Services/RegulatorServiceInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function amount(Wallet $wallet): string;
4848
* If the value does not exist, it will be created. If the value already exists, it will be updated.
4949
*
5050
* @param Wallet $wallet The wallet to synchronize.
51-
* @param float|int|non-empty-string $value The value to synchronize.
51+
* @param float|int|non-empty-string $value The value to synchronize.
5252
* @return non-empty-string True if the synchronization was successful, false otherwise.
5353
*/
5454
public function sync(Wallet $wallet, float|int|string $value): bool;
@@ -59,7 +59,7 @@ public function sync(Wallet $wallet, float|int|string $value): bool;
5959
* This method increases the stored value associated with the provided wallet by the given amount.
6060
*
6161
* @param Wallet $wallet The wallet to increase.
62-
* @param float|int|non-empty-string $value The amount to increase the stored value by.
62+
* @param float|int|non-empty-string $value The amount to increase the stored value by.
6363
* @return non-empty-string The updated stored value, formatted as a string with the same decimal places as the wallet.
6464
*/
6565
public function increase(Wallet $wallet, float|int|string $value): string;
@@ -70,7 +70,7 @@ public function increase(Wallet $wallet, float|int|string $value): string;
7070
* This method decreases the stored value associated with the provided wallet by the given amount.
7171
*
7272
* @param Wallet $wallet The wallet to decrease.
73-
* @param float|int|string $value The amount to decrease the stored value by.
73+
* @param float|int|string $value The amount to decrease the stored value by.
7474
* @return string The updated stored value, formatted as a string with the same decimal places as the wallet.
7575
*/
7676
public function decrease(Wallet $wallet, float|int|string $value): string;

src/Services/TaxServiceInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface TaxServiceInterface
2020
* The result is then rounded to the wallet's decimal places and formatted as a string.
2121
*
2222
* @param Wallet $wallet The wallet to calculate the fee for.
23-
* @param float|int|string $amount The amount to calculate the fee for.
23+
* @param float|int|string $amount The amount to calculate the fee for.
2424
* @return string The fee, formatted as a string with the same decimal places as the wallet.
2525
*
2626
* @see \Bavix\Wallet\Interfaces\Taxable::getFeePercent()

src/Traits/CanConfirm.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function confirm(Transaction $transaction): bool
5050
if ($transaction->type === Transaction::TYPE_WITHDRAW) {
5151
// Check if the wallet has enough money
5252
app(ConsistencyServiceInterface::class)->checkPotential(
53-
// Get the wallet
53+
// Get the wallet
5454
app(CastServiceInterface::class)->getWallet($this),
5555
// Negative amount
5656
app(MathServiceInterface::class)->negative($transaction->amount)
@@ -120,7 +120,7 @@ public function resetConfirm(Transaction $transaction): bool
120120
// Check if the transaction is already confirmed
121121
if (! $transaction->confirmed) {
122122
throw new UnconfirmedInvalid(
123-
// If the transaction is not confirmed, throw an `UnconfirmedInvalid` exception
123+
// If the transaction is not confirmed, throw an `UnconfirmedInvalid` exception
124124
app(TranslatorServiceInterface::class)->get('wallet::errors.unconfirmed_invalid'),
125125
// The code of the exception
126126
ExceptionInterface::UNCONFIRMED_INVALID
@@ -131,7 +131,7 @@ public function resetConfirm(Transaction $transaction): bool
131131
$wallet = app(CastServiceInterface::class)->getWallet($this);
132132
if ($wallet->getKey() !== $transaction->wallet_id) {
133133
throw new WalletOwnerInvalid(
134-
// If the transaction does not belong to the wallet, throw a `WalletOwnerInvalid` exception
134+
// If the transaction does not belong to the wallet, throw a `WalletOwnerInvalid` exception
135135
app(TranslatorServiceInterface::class)->get('wallet::errors.owner_invalid'),
136136
// The code of the exception
137137
ExceptionInterface::WALLET_OWNER_INVALID

src/Traits/CanExchange.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function forceExchange(Wallet $to, int|string $amount, ExtraDtoInterface|
160160
$castService->getWallet($this)
161161
->getCurrencyAttribute(),
162162
$castService->getWallet($to)
163-
->currency,
163+
->currency,
164164
1
165165
);
166166

0 commit comments

Comments
 (0)