diff --git a/rector.php b/rector.php index 2713dfdc7..945b1ac02 100644 --- a/rector.php +++ b/rector.php @@ -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); }; diff --git a/src/External/Api/TransactionQuery.php b/src/External/Api/TransactionQuery.php index 3d1654a5c..08659160b 100644 --- a/src/External/Api/TransactionQuery.php +++ b/src/External/Api/TransactionQuery.php @@ -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; @@ -18,12 +18,12 @@ final class TransactionQuery * @param array|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 ) { } diff --git a/src/External/Api/TransactionQueryHandler.php b/src/External/Api/TransactionQueryHandler.php index 13f6786f2..5df4a661f 100644 --- a/src/External/Api/TransactionQueryHandler.php +++ b/src/External/Api/TransactionQueryHandler.php @@ -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 ) { } diff --git a/src/External/Api/TransferQuery.php b/src/External/Api/TransferQuery.php index a13b99149..aeba1e501 100644 --- a/src/External/Api/TransferQuery.php +++ b/src/External/Api/TransferQuery.php @@ -7,16 +7,16 @@ use Bavix\Wallet\External\Contracts\ExtraDtoInterface; use Bavix\Wallet\Interfaces\Wallet; -final class TransferQuery +final readonly class TransferQuery { /** * @param array|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 ) { } diff --git a/src/External/Api/TransferQueryHandler.php b/src/External/Api/TransferQueryHandler.php index 156355581..51d72ea95 100644 --- a/src/External/Api/TransferQueryHandler.php +++ b/src/External/Api/TransferQueryHandler.php @@ -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 ) { } diff --git a/src/External/Dto/Option.php b/src/External/Dto/Option.php index 020ab8a4c..801f186f9 100644 --- a/src/External/Dto/Option.php +++ b/src/External/Dto/Option.php @@ -6,15 +6,15 @@ use Bavix\Wallet\External\Contracts\OptionDtoInterface; -final class Option implements OptionDtoInterface +final readonly class Option implements OptionDtoInterface { /** * @param null|array $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 ) { } diff --git a/src/Internal/Assembler/BalanceUpdatedEventAssembler.php b/src/Internal/Assembler/BalanceUpdatedEventAssembler.php index 2a423a851..fe1affae8 100644 --- a/src/Internal/Assembler/BalanceUpdatedEventAssembler.php +++ b/src/Internal/Assembler/BalanceUpdatedEventAssembler.php @@ -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 ) { } diff --git a/src/Internal/Assembler/ExtraDtoAssembler.php b/src/Internal/Assembler/ExtraDtoAssembler.php index c5aaf64d3..fa28896f0 100644 --- a/src/Internal/Assembler/ExtraDtoAssembler.php +++ b/src/Internal/Assembler/ExtraDtoAssembler.php @@ -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 ) { } diff --git a/src/Internal/Assembler/TransactionCreatedEventAssembler.php b/src/Internal/Assembler/TransactionCreatedEventAssembler.php index a2783b580..c37ccb921 100644 --- a/src/Internal/Assembler/TransactionCreatedEventAssembler.php +++ b/src/Internal/Assembler/TransactionCreatedEventAssembler.php @@ -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 ) { } diff --git a/src/Internal/Assembler/TransactionDtoAssembler.php b/src/Internal/Assembler/TransactionDtoAssembler.php index 1279e4cde..e183d60c3 100644 --- a/src/Internal/Assembler/TransactionDtoAssembler.php +++ b/src/Internal/Assembler/TransactionDtoAssembler.php @@ -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 ) { } diff --git a/src/Internal/Assembler/TransferDtoAssembler.php b/src/Internal/Assembler/TransferDtoAssembler.php index 0f2f804fd..280580f3b 100644 --- a/src/Internal/Assembler/TransferDtoAssembler.php +++ b/src/Internal/Assembler/TransferDtoAssembler.php @@ -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 ) { } diff --git a/src/Internal/Assembler/WalletCreatedEventAssembler.php b/src/Internal/Assembler/WalletCreatedEventAssembler.php index 5c1b8a90c..86eadd2e1 100644 --- a/src/Internal/Assembler/WalletCreatedEventAssembler.php +++ b/src/Internal/Assembler/WalletCreatedEventAssembler.php @@ -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 ) { } diff --git a/src/Internal/Decorator/StorageServiceLockDecorator.php b/src/Internal/Decorator/StorageServiceLockDecorator.php index 699519529..1e4c449c3 100644 --- a/src/Internal/Decorator/StorageServiceLockDecorator.php +++ b/src/Internal/Decorator/StorageServiceLockDecorator.php @@ -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 ) { } diff --git a/src/Internal/Dto/AvailabilityDto.php b/src/Internal/Dto/AvailabilityDto.php index e1406654d..af4ffbfc4 100644 --- a/src/Internal/Dto/AvailabilityDto.php +++ b/src/Internal/Dto/AvailabilityDto.php @@ -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 ) { } diff --git a/src/Internal/Dto/BasketDto.php b/src/Internal/Dto/BasketDto.php index 6191cc4e9..22b605461 100644 --- a/src/Internal/Dto/BasketDto.php +++ b/src/Internal/Dto/BasketDto.php @@ -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 $items * @param array $meta */ public function __construct( - private readonly array $items, - private readonly array $meta + private array $items, + private array $meta ) { } diff --git a/src/Internal/Dto/ItemDto.php b/src/Internal/Dto/ItemDto.php index 94f23d2b4..4af3c87f0 100644 --- a/src/Internal/Dto/ItemDto.php +++ b/src/Internal/Dto/ItemDto.php @@ -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, ) { } diff --git a/src/Internal/Dto/TransactionDto.php b/src/Internal/Dto/TransactionDto.php index a32431f47..f74d5aeec 100644 --- a/src/Internal/Dto/TransactionDto.php +++ b/src/Internal/Dto/TransactionDto.php @@ -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|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(); diff --git a/src/Internal/Dto/TransferDto.php b/src/Internal/Dto/TransferDto.php index f50f1b748..0d408a82b 100644 --- a/src/Internal/Dto/TransferDto.php +++ b/src/Internal/Dto/TransferDto.php @@ -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(); diff --git a/src/Internal/Dto/TransferLazyDto.php b/src/Internal/Dto/TransferLazyDto.php index f52f1c32b..c0332479e 100644 --- a/src/Internal/Dto/TransferLazyDto.php +++ b/src/Internal/Dto/TransferLazyDto.php @@ -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 ) { } diff --git a/src/Internal/Events/BalanceUpdatedEvent.php b/src/Internal/Events/BalanceUpdatedEvent.php index 394ab4b42..622f5905e 100644 --- a/src/Internal/Events/BalanceUpdatedEvent.php +++ b/src/Internal/Events/BalanceUpdatedEvent.php @@ -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 ) { } diff --git a/src/Internal/Events/TransactionCreatedEvent.php b/src/Internal/Events/TransactionCreatedEvent.php index c4889e5f5..967be068d 100644 --- a/src/Internal/Events/TransactionCreatedEvent.php +++ b/src/Internal/Events/TransactionCreatedEvent.php @@ -6,13 +6,13 @@ use DateTimeImmutable; -final class TransactionCreatedEvent implements TransactionCreatedEventInterface +final readonly class TransactionCreatedEvent implements TransactionCreatedEventInterface { public function __construct( - private readonly int $id, - private readonly string $type, - private readonly int $walletId, - private readonly DateTimeImmutable $createdAt, + private int $id, + private string $type, + private int $walletId, + private DateTimeImmutable $createdAt, ) { } diff --git a/src/Internal/Events/WalletCreatedEvent.php b/src/Internal/Events/WalletCreatedEvent.php index b6ecc1808..30c1910e5 100644 --- a/src/Internal/Events/WalletCreatedEvent.php +++ b/src/Internal/Events/WalletCreatedEvent.php @@ -6,14 +6,14 @@ use DateTimeImmutable; -final class WalletCreatedEvent implements WalletCreatedEventInterface +final readonly class WalletCreatedEvent implements WalletCreatedEventInterface { public function __construct( - private readonly string $holderType, - private readonly int|string $holderId, - private readonly string $walletUuid, - private readonly int $walletId, - private readonly DateTimeImmutable $createdAt + private string $holderType, + private int|string $holderId, + private string $walletUuid, + private int $walletId, + private DateTimeImmutable $createdAt ) { } diff --git a/src/Internal/Observers/TransferObserver.php b/src/Internal/Observers/TransferObserver.php index ec1bdee78..136670302 100644 --- a/src/Internal/Observers/TransferObserver.php +++ b/src/Internal/Observers/TransferObserver.php @@ -13,10 +13,10 @@ use Bavix\Wallet\Services\AtomicServiceInterface; use Illuminate\Database\RecordsNotFoundException; -final class TransferObserver +final readonly class TransferObserver { public function __construct( - private readonly AtomicServiceInterface $atomicService + private AtomicServiceInterface $atomicService ) { } diff --git a/src/Internal/Query/TransactionQuery.php b/src/Internal/Query/TransactionQuery.php index db2cfac9f..51ab135fc 100644 --- a/src/Internal/Query/TransactionQuery.php +++ b/src/Internal/Query/TransactionQuery.php @@ -8,13 +8,13 @@ * @immutable * @internal */ -final class TransactionQuery implements TransactionQueryInterface +final readonly class TransactionQuery implements TransactionQueryInterface { /** * @param non-empty-array $uuids */ public function __construct( - private readonly array $uuids + private array $uuids ) { } diff --git a/src/Internal/Query/TransferQuery.php b/src/Internal/Query/TransferQuery.php index e4cd6e663..3486a266e 100644 --- a/src/Internal/Query/TransferQuery.php +++ b/src/Internal/Query/TransferQuery.php @@ -8,13 +8,13 @@ * @immutable * @internal */ -final class TransferQuery implements TransferQueryInterface +final readonly class TransferQuery implements TransferQueryInterface { /** * @param non-empty-array $uuids */ public function __construct( - private readonly array $uuids + private array $uuids ) { } diff --git a/src/Internal/Repository/TransactionRepository.php b/src/Internal/Repository/TransactionRepository.php index 9f2246a51..185fd415f 100644 --- a/src/Internal/Repository/TransactionRepository.php +++ b/src/Internal/Repository/TransactionRepository.php @@ -10,12 +10,12 @@ use Bavix\Wallet\Internal\Transform\TransactionDtoTransformerInterface; use Bavix\Wallet\Models\Transaction; -final class TransactionRepository implements TransactionRepositoryInterface +final readonly class TransactionRepository implements TransactionRepositoryInterface { public function __construct( - private readonly TransactionDtoTransformerInterface $transformer, - private readonly JsonServiceInterface $jsonService, - private readonly Transaction $transaction + private TransactionDtoTransformerInterface $transformer, + private JsonServiceInterface $jsonService, + private Transaction $transaction ) { } diff --git a/src/Internal/Repository/TransferRepository.php b/src/Internal/Repository/TransferRepository.php index 6e982f1fe..b89bcb0e3 100644 --- a/src/Internal/Repository/TransferRepository.php +++ b/src/Internal/Repository/TransferRepository.php @@ -9,11 +9,11 @@ use Bavix\Wallet\Internal\Transform\TransferDtoTransformerInterface; use Bavix\Wallet\Models\Transfer; -final class TransferRepository implements TransferRepositoryInterface +final readonly class TransferRepository implements TransferRepositoryInterface { public function __construct( - private readonly TransferDtoTransformerInterface $transformer, - private readonly Transfer $transfer + private TransferDtoTransformerInterface $transformer, + private Transfer $transfer ) { } diff --git a/src/Internal/Repository/WalletRepository.php b/src/Internal/Repository/WalletRepository.php index a01165b77..893889ef8 100644 --- a/src/Internal/Repository/WalletRepository.php +++ b/src/Internal/Repository/WalletRepository.php @@ -9,10 +9,10 @@ use Bavix\Wallet\Models\Wallet; use Illuminate\Database\Eloquent\ModelNotFoundException as EloquentModelNotFoundException; -final class WalletRepository implements WalletRepositoryInterface +final readonly class WalletRepository implements WalletRepositoryInterface { public function __construct( - private readonly Wallet $wallet + private Wallet $wallet ) { } diff --git a/src/Internal/Service/DatabaseService.php b/src/Internal/Service/DatabaseService.php index ab6852f0e..c64d591c7 100644 --- a/src/Internal/Service/DatabaseService.php +++ b/src/Internal/Service/DatabaseService.php @@ -10,10 +10,10 @@ use Illuminate\Database\RecordsNotFoundException; use Throwable; -final class DatabaseService implements DatabaseServiceInterface +final readonly class DatabaseService implements DatabaseServiceInterface { public function __construct( - private readonly ConnectionServiceInterface $connectionService + private ConnectionServiceInterface $connectionService ) { } diff --git a/src/Internal/Service/MathService.php b/src/Internal/Service/MathService.php index 8ce6e90d2..55680f139 100644 --- a/src/Internal/Service/MathService.php +++ b/src/Internal/Service/MathService.php @@ -7,10 +7,10 @@ use Brick\Math\BigDecimal; use Brick\Math\RoundingMode; -final class MathService implements MathServiceInterface +final readonly class MathService implements MathServiceInterface { public function __construct( - private readonly int $scale + private int $scale ) { } diff --git a/src/Internal/Service/StorageService.php b/src/Internal/Service/StorageService.php index b1181b731..97bf2b952 100644 --- a/src/Internal/Service/StorageService.php +++ b/src/Internal/Service/StorageService.php @@ -8,14 +8,14 @@ use Bavix\Wallet\Internal\Exceptions\RecordNotFoundException; use Illuminate\Contracts\Cache\Repository as CacheRepository; -final class StorageService implements StorageServiceInterface +final readonly class StorageService implements StorageServiceInterface { private const PREFIX = 'wallet_sg::'; public function __construct( - private readonly MathServiceInterface $mathService, - private readonly CacheRepository $cacheRepository, - private readonly ?int $ttl + private MathServiceInterface $mathService, + private CacheRepository $cacheRepository, + private ?int $ttl ) { } diff --git a/src/Internal/Service/TranslatorService.php b/src/Internal/Service/TranslatorService.php index 9fac67f89..76b41f9a2 100644 --- a/src/Internal/Service/TranslatorService.php +++ b/src/Internal/Service/TranslatorService.php @@ -6,10 +6,10 @@ use Illuminate\Contracts\Translation\Translator; -final class TranslatorService implements TranslatorServiceInterface +final readonly class TranslatorService implements TranslatorServiceInterface { public function __construct( - private readonly Translator $translator + private Translator $translator ) { } diff --git a/src/Internal/Service/UuidFactoryService.php b/src/Internal/Service/UuidFactoryService.php index e672b5d18..e08329e7b 100644 --- a/src/Internal/Service/UuidFactoryService.php +++ b/src/Internal/Service/UuidFactoryService.php @@ -6,10 +6,10 @@ use Ramsey\Uuid\UuidFactory; -final class UuidFactoryService implements UuidFactoryServiceInterface +final readonly class UuidFactoryService implements UuidFactoryServiceInterface { public function __construct( - private readonly UuidFactory $uuidFactory + private UuidFactory $uuidFactory ) { } diff --git a/src/Services/AssistantService.php b/src/Services/AssistantService.php index d2f152fdb..4c8f7a29a 100644 --- a/src/Services/AssistantService.php +++ b/src/Services/AssistantService.php @@ -14,11 +14,11 @@ /** * @internal */ -final class AssistantService implements AssistantServiceInterface +final readonly class AssistantService implements AssistantServiceInterface { public function __construct( - private readonly CastServiceInterface $castService, - private readonly MathServiceInterface $mathService + private CastServiceInterface $castService, + private MathServiceInterface $mathService ) { } diff --git a/src/Services/AtmService.php b/src/Services/AtmService.php index 84ee2de37..4861dd569 100644 --- a/src/Services/AtmService.php +++ b/src/Services/AtmService.php @@ -16,14 +16,14 @@ /** * @internal */ -final class AtmService implements AtmServiceInterface +final readonly class AtmService implements AtmServiceInterface { public function __construct( - private readonly TransactionQueryAssemblerInterface $transactionQueryAssembler, - private readonly TransferQueryAssemblerInterface $transferQueryAssembler, - private readonly TransactionRepositoryInterface $transactionRepository, - private readonly TransferRepositoryInterface $transferRepository, - private readonly AssistantServiceInterface $assistantService + private TransactionQueryAssemblerInterface $transactionQueryAssembler, + private TransferQueryAssemblerInterface $transferQueryAssembler, + private TransactionRepositoryInterface $transactionRepository, + private TransferRepositoryInterface $transferRepository, + private AssistantServiceInterface $assistantService ) { } diff --git a/src/Services/AtomicService.php b/src/Services/AtomicService.php index de498e9a9..02c074ba7 100644 --- a/src/Services/AtomicService.php +++ b/src/Services/AtomicService.php @@ -15,14 +15,14 @@ /** * @internal */ -final class AtomicService implements AtomicServiceInterface +final readonly class AtomicService implements AtomicServiceInterface { public function __construct( - private readonly BookkeeperServiceInterface $bookkeeperService, - private readonly DatabaseServiceInterface $databaseService, - private readonly StateServiceInterface $stateService, - private readonly LockServiceInterface $lockService, - private readonly CastServiceInterface $castService + private BookkeeperServiceInterface $bookkeeperService, + private DatabaseServiceInterface $databaseService, + private StateServiceInterface $stateService, + private LockServiceInterface $lockService, + private CastServiceInterface $castService ) { } diff --git a/src/Services/BookkeeperService.php b/src/Services/BookkeeperService.php index 2eb53cf40..558ed155b 100644 --- a/src/Services/BookkeeperService.php +++ b/src/Services/BookkeeperService.php @@ -12,11 +12,11 @@ /** * @internal */ -final class BookkeeperService implements BookkeeperServiceInterface +final readonly class BookkeeperService implements BookkeeperServiceInterface { public function __construct( - private readonly StorageServiceInterface $storageService, - private readonly LockServiceInterface $lockService + private StorageServiceInterface $storageService, + private LockServiceInterface $lockService ) { } diff --git a/src/Services/CastService.php b/src/Services/CastService.php index 8ffe36f0b..80ed50d53 100644 --- a/src/Services/CastService.php +++ b/src/Services/CastService.php @@ -15,12 +15,12 @@ /** * @internal */ -final class CastService implements CastServiceInterface +final readonly class CastService implements CastServiceInterface { public function __construct( - private readonly WalletCreatedEventAssemblerInterface $walletCreatedEventAssembler, - private readonly DispatcherServiceInterface $dispatcherService, - private readonly DatabaseServiceInterface $databaseService + private WalletCreatedEventAssemblerInterface $walletCreatedEventAssembler, + private DispatcherServiceInterface $dispatcherService, + private DatabaseServiceInterface $databaseService ) { } diff --git a/src/Services/ConsistencyService.php b/src/Services/ConsistencyService.php index 30762b192..92f3c9334 100644 --- a/src/Services/ConsistencyService.php +++ b/src/Services/ConsistencyService.php @@ -16,12 +16,12 @@ /** * @internal */ -final class ConsistencyService implements ConsistencyServiceInterface +final readonly class ConsistencyService implements ConsistencyServiceInterface { public function __construct( - private readonly TranslatorServiceInterface $translatorService, - private readonly MathServiceInterface $mathService, - private readonly CastServiceInterface $castService + private TranslatorServiceInterface $translatorService, + private MathServiceInterface $mathService, + private CastServiceInterface $castService ) { } diff --git a/src/Services/EagerLoaderService.php b/src/Services/EagerLoaderService.php index 4303d7b9b..e947695a3 100644 --- a/src/Services/EagerLoaderService.php +++ b/src/Services/EagerLoaderService.php @@ -12,11 +12,11 @@ /** * @internal */ -final class EagerLoaderService implements EagerLoaderServiceInterface +final readonly class EagerLoaderService implements EagerLoaderServiceInterface { public function __construct( - private readonly CastServiceInterface $castService, - private readonly WalletRepositoryInterface $walletRepository + private CastServiceInterface $castService, + private WalletRepositoryInterface $walletRepository ) { } diff --git a/src/Services/FormatterService.php b/src/Services/FormatterService.php index b078cfd14..0adbeff8a 100644 --- a/src/Services/FormatterService.php +++ b/src/Services/FormatterService.php @@ -7,6 +7,9 @@ use Brick\Math\BigDecimal; use Brick\Math\RoundingMode; +/** + * @internal + */ final readonly class FormatterService implements FormatterServiceInterface { public function intValue(string|int|float $amount, int $decimalPlaces): string diff --git a/src/Services/FormatterServiceInterface.php b/src/Services/FormatterServiceInterface.php index e2d8eee2f..1b1ff1767 100644 --- a/src/Services/FormatterServiceInterface.php +++ b/src/Services/FormatterServiceInterface.php @@ -5,7 +5,7 @@ namespace Bavix\Wallet\Services; /** - * @internal + * @api */ interface FormatterServiceInterface { diff --git a/src/Services/PrepareService.php b/src/Services/PrepareService.php index e38d87051..55379ae66 100644 --- a/src/Services/PrepareService.php +++ b/src/Services/PrepareService.php @@ -19,17 +19,17 @@ /** * @internal */ -final class PrepareService implements PrepareServiceInterface +final readonly class PrepareService implements PrepareServiceInterface { public function __construct( - private readonly TransferLazyDtoAssemblerInterface $transferLazyDtoAssembler, - private readonly TransactionDtoAssemblerInterface $transactionDtoAssembler, - private readonly DiscountServiceInterface $personalDiscountService, - private readonly ConsistencyServiceInterface $consistencyService, - private readonly ExtraDtoAssemblerInterface $extraDtoAssembler, - private readonly CastServiceInterface $castService, - private readonly MathServiceInterface $mathService, - private readonly TaxServiceInterface $taxService + private TransferLazyDtoAssemblerInterface $transferLazyDtoAssembler, + private TransactionDtoAssemblerInterface $transactionDtoAssembler, + private DiscountServiceInterface $personalDiscountService, + private ConsistencyServiceInterface $consistencyService, + private ExtraDtoAssemblerInterface $extraDtoAssembler, + private CastServiceInterface $castService, + private MathServiceInterface $mathService, + private TaxServiceInterface $taxService ) { } diff --git a/src/Services/PurchaseService.php b/src/Services/PurchaseService.php index 0b5405b19..bb18499c3 100644 --- a/src/Services/PurchaseService.php +++ b/src/Services/PurchaseService.php @@ -11,10 +11,10 @@ /** * @internal */ -final class PurchaseService implements PurchaseServiceInterface +final readonly class PurchaseService implements PurchaseServiceInterface { public function __construct( - private readonly CastServiceInterface $castService + private CastServiceInterface $castService ) { } diff --git a/src/Services/TaxService.php b/src/Services/TaxService.php index 6e527d8fe..adcb3175e 100644 --- a/src/Services/TaxService.php +++ b/src/Services/TaxService.php @@ -13,11 +13,11 @@ /** * @internal */ -final class TaxService implements TaxServiceInterface +final readonly class TaxService implements TaxServiceInterface { public function __construct( - private readonly MathServiceInterface $mathService, - private readonly CastServiceInterface $castService + private MathServiceInterface $mathService, + private CastServiceInterface $castService ) { } diff --git a/src/Services/TransactionService.php b/src/Services/TransactionService.php index 178adf2c9..c5b43d081 100644 --- a/src/Services/TransactionService.php +++ b/src/Services/TransactionService.php @@ -14,16 +14,16 @@ /** * @internal */ -final class TransactionService implements TransactionServiceInterface +final readonly class TransactionService implements TransactionServiceInterface { public function __construct( - private readonly TransactionCreatedEventAssemblerInterface $transactionCreatedEventAssembler, - private readonly DispatcherServiceInterface $dispatcherService, - private readonly AssistantServiceInterface $assistantService, - private readonly RegulatorServiceInterface $regulatorService, - private readonly PrepareServiceInterface $prepareService, - private readonly CastServiceInterface $castService, - private readonly AtmServiceInterface $atmService, + private TransactionCreatedEventAssemblerInterface $transactionCreatedEventAssembler, + private DispatcherServiceInterface $dispatcherService, + private AssistantServiceInterface $assistantService, + private RegulatorServiceInterface $regulatorService, + private PrepareServiceInterface $prepareService, + private CastServiceInterface $castService, + private AtmServiceInterface $atmService, ) { } diff --git a/src/Services/TransferService.php b/src/Services/TransferService.php index fa98b710b..18ede128a 100644 --- a/src/Services/TransferService.php +++ b/src/Services/TransferService.php @@ -18,15 +18,15 @@ /** * @internal */ -final class TransferService implements TransferServiceInterface +final readonly class TransferService implements TransferServiceInterface { public function __construct( - private readonly TransferDtoAssemblerInterface $transferDtoAssembler, - private readonly TransferRepositoryInterface $transferRepository, - private readonly TransactionServiceInterface $transactionService, - private readonly DatabaseServiceInterface $databaseService, - private readonly CastServiceInterface $castService, - private readonly AtmServiceInterface $atmService, + private TransferDtoAssemblerInterface $transferDtoAssembler, + private TransferRepositoryInterface $transferRepository, + private TransactionServiceInterface $transactionService, + private DatabaseServiceInterface $databaseService, + private CastServiceInterface $castService, + private AtmServiceInterface $atmService, ) { } diff --git a/src/Services/WalletService.php b/src/Services/WalletService.php index f2f34ba03..d33a072c9 100644 --- a/src/Services/WalletService.php +++ b/src/Services/WalletService.php @@ -15,13 +15,13 @@ /** * @internal */ -final class WalletService implements WalletServiceInterface +final readonly class WalletService implements WalletServiceInterface { public function __construct( - private readonly WalletCreatedEventAssemblerInterface $walletCreatedEventAssembler, - private readonly UuidFactoryServiceInterface $uuidFactoryService, - private readonly DispatcherServiceInterface $dispatcherService, - private readonly WalletRepositoryInterface $walletRepository + private WalletCreatedEventAssemblerInterface $walletCreatedEventAssembler, + private UuidFactoryServiceInterface $uuidFactoryService, + private DispatcherServiceInterface $dispatcherService, + private WalletRepositoryInterface $walletRepository ) { } diff --git a/tests/Infra/Transform/TransactionDtoTransformerCustom.php b/tests/Infra/Transform/TransactionDtoTransformerCustom.php index 501f67368..6fe4e07d3 100644 --- a/tests/Infra/Transform/TransactionDtoTransformerCustom.php +++ b/tests/Infra/Transform/TransactionDtoTransformerCustom.php @@ -8,10 +8,10 @@ use Bavix\Wallet\Internal\Transform\TransactionDtoTransformer; use Bavix\Wallet\Internal\Transform\TransactionDtoTransformerInterface; -final class TransactionDtoTransformerCustom implements TransactionDtoTransformerInterface +final readonly class TransactionDtoTransformerCustom implements TransactionDtoTransformerInterface { public function __construct( - private readonly TransactionDtoTransformer $transactionDtoTransformer + private TransactionDtoTransformer $transactionDtoTransformer ) { }