Skip to content

Commit

Permalink
rector fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Jan 5, 2024
1 parent 9d2fdc2 commit d8c2ad8
Show file tree
Hide file tree
Showing 49 changed files with 199 additions and 196 deletions.
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
$config->import(PHPUnitSetList::PHPUNIT_100);
$config->import(SetList::CODE_QUALITY);
$config->import(SetList::DEAD_CODE);
$config->import(SetList::PHP_81);
$config->import(SetList::PHP_82);
};
14 changes: 7 additions & 7 deletions src/External/Api/TransactionQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Bavix\Wallet\Interfaces\Wallet;
use Bavix\Wallet\Models\Transaction;

final class TransactionQuery
final readonly class TransactionQuery
{
public const TYPE_DEPOSIT = Transaction::TYPE_DEPOSIT;

Expand All @@ -18,12 +18,12 @@ final class TransactionQuery
* @param array<mixed>|null $meta
*/
private function __construct(
private readonly string $type,
private readonly Wallet $wallet,
private readonly float|int|string $amount,
private readonly ?array $meta,
private readonly bool $confirmed,
private readonly ?string $uuid
private string $type,
private Wallet $wallet,
private float|int|string $amount,
private ?array $meta,
private bool $confirmed,
private ?string $uuid
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/External/Api/TransactionQueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
/**
* @internal
*/
final class TransactionQueryHandler implements TransactionQueryHandlerInterface
final readonly class TransactionQueryHandler implements TransactionQueryHandlerInterface
{
public function __construct(
private readonly TransactionServiceInterface $transactionService,
private readonly AssistantServiceInterface $assistantService,
private readonly PrepareServiceInterface $prepareService,
private readonly AtomicServiceInterface $atomicService
private TransactionServiceInterface $transactionService,
private AssistantServiceInterface $assistantService,
private PrepareServiceInterface $prepareService,
private AtomicServiceInterface $atomicService
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/External/Api/TransferQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
use Bavix\Wallet\External\Contracts\ExtraDtoInterface;
use Bavix\Wallet\Interfaces\Wallet;

final class TransferQuery
final readonly class TransferQuery
{
/**
* @param array<mixed>|ExtraDtoInterface|null $meta
*/
public function __construct(
private readonly Wallet $from,
private readonly Wallet $to,
private readonly float|int|string $amount,
private readonly array|ExtraDtoInterface|null $meta
private Wallet $from,
private Wallet $to,
private float|int|string $amount,
private array|ExtraDtoInterface|null $meta
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/External/Api/TransferQueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
/**
* @internal
*/
final class TransferQueryHandler implements TransferQueryHandlerInterface
final readonly class TransferQueryHandler implements TransferQueryHandlerInterface
{
public function __construct(
private readonly AssistantServiceInterface $assistantService,
private readonly TransferServiceInterface $transferService,
private readonly PrepareServiceInterface $prepareService,
private readonly AtomicServiceInterface $atomicService
private AssistantServiceInterface $assistantService,
private TransferServiceInterface $transferService,
private PrepareServiceInterface $prepareService,
private AtomicServiceInterface $atomicService
) {
}

Expand Down
8 changes: 4 additions & 4 deletions src/External/Dto/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

use Bavix\Wallet\External\Contracts\OptionDtoInterface;

final class Option implements OptionDtoInterface
final readonly class Option implements OptionDtoInterface
{
/**
* @param null|array<mixed> $meta
*/
public function __construct(
private readonly ?array $meta,
private readonly bool $confirmed = true,
private readonly ?string $uuid = null
private ?array $meta,
private bool $confirmed = true,
private ?string $uuid = null
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Assembler/BalanceUpdatedEventAssembler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use Bavix\Wallet\Internal\Service\ClockServiceInterface;
use Bavix\Wallet\Models\Wallet;

final class BalanceUpdatedEventAssembler implements BalanceUpdatedEventAssemblerInterface
final readonly class BalanceUpdatedEventAssembler implements BalanceUpdatedEventAssemblerInterface
{
public function __construct(
private readonly ClockServiceInterface $clockService
private ClockServiceInterface $clockService
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Assembler/ExtraDtoAssembler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use Bavix\Wallet\External\Contracts\ExtraDtoInterface;
use Bavix\Wallet\External\Dto\Extra;

final class ExtraDtoAssembler implements ExtraDtoAssemblerInterface
final readonly class ExtraDtoAssembler implements ExtraDtoAssemblerInterface
{
public function __construct(
private readonly OptionDtoAssemblerInterface $optionDtoAssembler
private OptionDtoAssemblerInterface $optionDtoAssembler
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Assembler/TransactionCreatedEventAssembler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use Bavix\Wallet\Internal\Service\ClockServiceInterface;
use Bavix\Wallet\Models\Transaction;

final class TransactionCreatedEventAssembler implements TransactionCreatedEventAssemblerInterface
final readonly class TransactionCreatedEventAssembler implements TransactionCreatedEventAssemblerInterface
{
public function __construct(
private readonly ClockServiceInterface $clockService
private ClockServiceInterface $clockService
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Assembler/TransactionDtoAssembler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use Bavix\Wallet\Internal\Service\UuidFactoryServiceInterface;
use Illuminate\Database\Eloquent\Model;

final class TransactionDtoAssembler implements TransactionDtoAssemblerInterface
final readonly class TransactionDtoAssembler implements TransactionDtoAssemblerInterface
{
public function __construct(
private readonly UuidFactoryServiceInterface $uuidService
private UuidFactoryServiceInterface $uuidService
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Assembler/TransferDtoAssembler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use Bavix\Wallet\Internal\Service\UuidFactoryServiceInterface;
use Illuminate\Database\Eloquent\Model;

final class TransferDtoAssembler implements TransferDtoAssemblerInterface
final readonly class TransferDtoAssembler implements TransferDtoAssemblerInterface
{
public function __construct(
private readonly UuidFactoryServiceInterface $uuidService
private UuidFactoryServiceInterface $uuidService
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Internal/Assembler/WalletCreatedEventAssembler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use Bavix\Wallet\Internal\Service\ClockServiceInterface;
use Bavix\Wallet\Models\Wallet;

final class WalletCreatedEventAssembler implements WalletCreatedEventAssemblerInterface
final readonly class WalletCreatedEventAssembler implements WalletCreatedEventAssemblerInterface
{
public function __construct(
private readonly ClockServiceInterface $clockService
private ClockServiceInterface $clockService
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/Internal/Decorator/StorageServiceLockDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
use Bavix\Wallet\Internal\Service\StateServiceInterface;
use Bavix\Wallet\Internal\Service\StorageServiceInterface;

final class StorageServiceLockDecorator implements StorageServiceInterface
final readonly class StorageServiceLockDecorator implements StorageServiceInterface
{
public function __construct(
private readonly StorageServiceInterface $storageService,
private readonly StateServiceInterface $stateService,
private readonly LockServiceInterface $lockService,
private readonly MathServiceInterface $mathService
private StorageServiceInterface $storageService,
private StateServiceInterface $stateService,
private LockServiceInterface $lockService,
private MathServiceInterface $mathService
) {
}

Expand Down
8 changes: 4 additions & 4 deletions src/Internal/Dto/AvailabilityDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use Bavix\Wallet\Interfaces\Customer;

/** @immutable */
final class AvailabilityDto implements AvailabilityDtoInterface
final readonly class AvailabilityDto implements AvailabilityDtoInterface
{
public function __construct(
private readonly Customer $customer,
private readonly BasketDtoInterface $basketDto,
private readonly bool $force
private Customer $customer,
private BasketDtoInterface $basketDto,
private bool $force
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Internal/Dto/BasketDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
use Bavix\Wallet\Interfaces\ProductInterface;
use Generator;

final class BasketDto implements BasketDtoInterface
final readonly class BasketDto implements BasketDtoInterface
{
/**
* @param non-empty-array<int|string, ItemDtoInterface> $items
* @param array<mixed> $meta
*/
public function __construct(
private readonly array $items,
private readonly array $meta
private array $items,
private array $meta
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/Internal/Dto/ItemDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
use Bavix\Wallet\Interfaces\Wallet;

/** @immutable */
final class ItemDto implements ItemDtoInterface
final readonly class ItemDto implements ItemDtoInterface
{
public function __construct(
private readonly ProductInterface $product,
private readonly int $quantity,
private readonly int|string|null $pricePerItem,
private readonly ?Wallet $receiving,
private ProductInterface $product,
private int $quantity,
private int|string|null $pricePerItem,
private ?Wallet $receiving,
) {
}

Expand Down
22 changes: 11 additions & 11 deletions src/Internal/Dto/TransactionDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
use DateTimeImmutable;

/** @immutable */
final class TransactionDto implements TransactionDtoInterface
final readonly class TransactionDto implements TransactionDtoInterface
{
private readonly DateTimeImmutable $createdAt;
private DateTimeImmutable $createdAt;

private readonly DateTimeImmutable $updatedAt;
private DateTimeImmutable $updatedAt;

/**
* @param array<mixed>|null $meta
*/
public function __construct(
private readonly string $uuid,
private readonly string $payableType,
private readonly int|string $payableId,
private readonly int $walletId,
private readonly string $type,
private readonly float|int|string $amount,
private readonly bool $confirmed,
private readonly ?array $meta
private string $uuid,
private string $payableType,
private int|string $payableId,
private int $walletId,
private string $type,
private float|int|string $amount,
private bool $confirmed,
private ?array $meta
) {
$this->createdAt = new DateTimeImmutable();
$this->updatedAt = new DateTimeImmutable();
Expand Down
22 changes: 11 additions & 11 deletions src/Internal/Dto/TransferDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
use DateTimeImmutable;

/** @immutable */
final class TransferDto implements TransferDtoInterface
final readonly class TransferDto implements TransferDtoInterface
{
private readonly DateTimeImmutable $createdAt;
private DateTimeImmutable $createdAt;

private readonly DateTimeImmutable $updatedAt;
private DateTimeImmutable $updatedAt;

public function __construct(
private readonly string $uuid,
private readonly int $depositId,
private readonly int $withdrawId,
private readonly string $status,
private readonly int|string $fromId,
private readonly int|string $toId,
private readonly int $discount,
private readonly string $fee
private string $uuid,
private int $depositId,
private int $withdrawId,
private string $status,
private int|string $fromId,
private int|string $toId,
private int $discount,
private string $fee
) {
$this->createdAt = new DateTimeImmutable();
$this->updatedAt = new DateTimeImmutable();
Expand Down
18 changes: 9 additions & 9 deletions src/Internal/Dto/TransferLazyDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
use Bavix\Wallet\Interfaces\Wallet;

/** @immutable */
final class TransferLazyDto implements TransferLazyDtoInterface
final readonly class TransferLazyDto implements TransferLazyDtoInterface
{
public function __construct(
private readonly Wallet $fromWallet,
private readonly Wallet $toWallet,
private readonly int $discount,
private readonly string $fee,
private readonly TransactionDtoInterface $withdrawDto,
private readonly TransactionDtoInterface $depositDto,
private readonly string $status,
private readonly ?string $uuid
private Wallet $fromWallet,
private Wallet $toWallet,
private int $discount,
private string $fee,
private TransactionDtoInterface $withdrawDto,
private TransactionDtoInterface $depositDto,
private string $status,
private ?string $uuid
) {
}

Expand Down
10 changes: 5 additions & 5 deletions src/Internal/Events/BalanceUpdatedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

use DateTimeImmutable;

final class BalanceUpdatedEvent implements BalanceUpdatedEventInterface
final readonly class BalanceUpdatedEvent implements BalanceUpdatedEventInterface
{
public function __construct(
private readonly int $walletId,
private readonly string $walletUuid,
private readonly string $balance,
private readonly DateTimeImmutable $updatedAt
private int $walletId,
private string $walletUuid,
private string $balance,
private DateTimeImmutable $updatedAt
) {
}

Expand Down
Loading

0 comments on commit d8c2ad8

Please sign in to comment.