Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monorepo] Use PHP 8.2 Rector set #1445

Merged
merged 6 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions monorepo/Release/TagVersionReleaseWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
use Symplify\MonorepoBuilder\Release\Process\ProcessRunner;
use Throwable;

final class TagVersionReleaseWorker implements ReleaseWorkerInterface
final readonly class TagVersionReleaseWorker implements ReleaseWorkerInterface
{
public function __construct(
private readonly GitManager $gitManager,
private readonly ClientInterface $httpClient,
private readonly ProcessRunner $processRunner,
private GitManager $gitManager,
private ClientInterface $httpClient,
private ProcessRunner $processRunner,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\SerializerInterface as SymfonySerializerInterface;

final class SymfonyActivitySubjectDataSerializer implements ActivitySubjectDataSerializerInterface
final readonly class SymfonyActivitySubjectDataSerializer implements ActivitySubjectDataSerializerInterface
{
/**
* @param string[] $disallowedProperties
*/
public function __construct(
private readonly SymfonySerializerInterface $serializer,
private readonly CircularReferenceHandlerInterface $circularReferenceHandler,
private readonly array $disallowedProperties,
private SymfonySerializerInterface $serializer,
private CircularReferenceHandlerInterface $circularReferenceHandler,
private array $disallowedProperties,
) {
}

Expand Down
8 changes: 4 additions & 4 deletions packages/EasyApiToken/src/Common/Generator/TokenGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

use Firebase\JWT\JWT;

final class TokenGenerator implements TokenGeneratorInterface
final readonly class TokenGenerator implements TokenGeneratorInterface
{
private const DEFAULT_ALGO = 'HS256';

public function __construct(
private readonly ?string $audience = null,
private readonly ?string $secret = null,
private readonly ?string $issuer = null,
private ?string $audience = null,
private ?string $secret = null,
private ?string $issuer = null,
) {
}

Expand Down
10 changes: 5 additions & 5 deletions packages/EasyApiToken/src/Firebase/Driver/FirebaseJwtDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
use Firebase\JWT\Key;
use OpenSSLAsymmetricKey;

final class FirebaseJwtDriver implements JwtDriverInterface
final readonly class FirebaseJwtDriver implements JwtDriverInterface
{
public function __construct(
private readonly string $algo,
private readonly OpenSSLAsymmetricKey|string $publicKey,
private readonly OpenSSLAsymmetricKey|string $privateKey,
private readonly ?int $leeway = null,
private string $algo,
private OpenSSLAsymmetricKey|string $publicKey,
private OpenSSLAsymmetricKey|string $privateKey,
private ?int $leeway = null,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
use EonX\EasyErrorHandler\Common\ErrorHandler\ErrorHandlerInterface;
use Illuminate\Queue\Events\WorkerStopping;

final class WorkerStoppingListener implements WorkerStoppingListenerInterface
final readonly class WorkerStoppingListener implements WorkerStoppingListenerInterface
{
public function __construct(
private readonly ErrorHandlerInterface $errorHandler,
private ErrorHandlerInterface $errorHandler,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use Psr\Log\NullLogger;
use Throwable;

final class ManagersSanityChecker
final readonly class ManagersSanityChecker
{
public function __construct(
private readonly ManagerRegistry $registry,
private readonly LoggerInterface $logger = new NullLogger(),
private ManagerRegistry $registry,
private LoggerInterface $logger = new NullLogger(),
) {
}

Expand Down
4 changes: 2 additions & 2 deletions packages/EasyAsync/src/Doctrine/Clearer/ManagersClearer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

use Doctrine\Persistence\ManagerRegistry;

final class ManagersClearer
final readonly class ManagersClearer
{
public function __construct(
private readonly ManagerRegistry $registry,
private ManagerRegistry $registry,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions packages/EasyAsync/src/Doctrine/Closer/ManagersCloser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;

final class ManagersCloser
final readonly class ManagersCloser
{
public function __construct(
private readonly ManagerRegistry $registry,
private readonly LoggerInterface $logger = new NullLogger(),
private ManagerRegistry $registry,
private LoggerInterface $logger = new NullLogger(),
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
use Symfony\Component\Messenger\Middleware\StackInterface;
use Symfony\Component\Messenger\Stamp\ConsumedByWorkerStamp;

final class DoctrineManagersClearMiddleware implements MiddlewareInterface
final readonly class DoctrineManagersClearMiddleware implements MiddlewareInterface
{
/**
* @param string[]|null $managers
*/
public function __construct(
private readonly ManagersClearer $managersClearer,
private readonly ?array $managers = null,
private ManagersClearer $managersClearer,
private ?array $managers = null,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
use Symfony\Component\Messenger\Middleware\StackInterface;
use Symfony\Component\Messenger\Stamp\ConsumedByWorkerStamp;

final class DoctrineManagersCloseConnectionMiddleware implements MiddlewareInterface
final readonly class DoctrineManagersCloseConnectionMiddleware implements MiddlewareInterface
{
/**
* @param string[]|null $managers
*/
public function __construct(
private readonly ManagersCloser $managersCloser,
private readonly ?array $managers = null,
private ManagersCloser $managersCloser,
private ?array $managers = null,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
use Symfony\Component\Messenger\Middleware\StackInterface;
use Symfony\Component\Messenger\Stamp\ConsumedByWorkerStamp;

final class DoctrineManagersSanityCheckMiddleware implements MiddlewareInterface
final readonly class DoctrineManagersSanityCheckMiddleware implements MiddlewareInterface
{
/**
* @param string[]|null $managers
*/
public function __construct(
private readonly ManagersSanityChecker $managersSanityChecker,
private readonly ?array $managers = null,
private ManagersSanityChecker $managersSanityChecker,
private ?array $managers = null,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Throwable;

final class MessageSerializer implements SerializerInterface
final readonly class MessageSerializer implements SerializerInterface
{
private const HEADER_RETRY = 'retry';

Expand All @@ -23,8 +23,8 @@ final class MessageSerializer implements SerializerInterface
private const KEY_HEADERS = 'headers';

public function __construct(
private readonly MessageBodyDecoderInterface $bodyDecoder,
private readonly MessageObjectFactoryInterface $messageFactory,
private MessageBodyDecoderInterface $bodyDecoder,
private MessageObjectFactoryInterface $messageFactory,
) {
}

Expand Down
10 changes: 5 additions & 5 deletions packages/EasyBatch/src/Common/Dispatcher/BatchItemDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
use EonX\EasyBatch\Common\ValueObject\BatchItemInterface;
use EonX\EasyBatch\Common\ValueObject\BatchItemIteratorConfig;

final class BatchItemDispatcher
final readonly class BatchItemDispatcher
{
public function __construct(
private readonly AsyncDispatcherInterface $asyncDispatcher,
private readonly BatchItemIteratorInterface $batchItemIterator,
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly BatchRepositoryInterface $batchRepository,
private AsyncDispatcherInterface $asyncDispatcher,
private BatchItemIteratorInterface $batchItemIterator,
private BatchItemRepositoryInterface $batchItemRepository,
private BatchRepositoryInterface $batchRepository,
) {
}

Expand Down
16 changes: 8 additions & 8 deletions packages/EasyBatch/src/Common/Manager/BatchObjectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
use EonX\EasyBatch\Common\ValueObject\BatchObjectInterface;
use EonX\EasyEventDispatcher\Dispatcher\EventDispatcherInterface;

final class BatchObjectManager implements BatchObjectManagerInterface
final readonly class BatchObjectManager implements BatchObjectManagerInterface
{
public function __construct(
private readonly BatchPersister $batchPersister,
private readonly BatchRepositoryInterface $batchRepository,
private readonly BatchProcessor $batchProcessor,
private readonly BatchItemDispatcher $batchItemDispatcher,
private readonly BatchItemIteratorInterface $batchItemIterator,
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly EventDispatcherInterface $eventDispatcher,
private BatchPersister $batchPersister,
private BatchRepositoryInterface $batchRepository,
private BatchProcessor $batchProcessor,
private BatchItemDispatcher $batchItemDispatcher,
private BatchItemIteratorInterface $batchItemIterator,
private BatchItemRepositoryInterface $batchItemRepository,
private EventDispatcherInterface $eventDispatcher,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
use EonX\EasyBatch\Common\ValueObject\BatchItemInterface;
use EonX\EasyBatch\Common\ValueObject\MessageWrapper;

final class BatchItemPersister
final readonly class BatchItemPersister
{
public function __construct(
private readonly BatchItemFactoryInterface $batchItemFactory,
private readonly BatchItemRepositoryInterface $batchItemRepository,
private BatchItemFactoryInterface $batchItemFactory,
private BatchItemRepositoryInterface $batchItemRepository,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions packages/EasyBatch/src/Common/Persister/BatchPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use EonX\EasyBatch\Common\ValueObject\BatchInterface;
use EonX\EasyBatch\Common\ValueObject\MessageWrapper;

final class BatchPersister
final readonly class BatchPersister
{
public function __construct(
private readonly BatchRepositoryInterface $batchRepository,
private readonly BatchItemPersister $batchItemPersister,
private BatchRepositoryInterface $batchRepository,
private BatchItemPersister $batchItemPersister,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
use EonX\EasyBatch\Common\ValueObject\BatchObjectInterface;
use Throwable;

final class BatchItemProcessor
final readonly class BatchItemProcessor
{
public function __construct(
private readonly BatchProcessor $batchProcessor,
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly BatchObjectManagerInterface $batchObjectManager,
private BatchProcessor $batchProcessor,
private BatchItemRepositoryInterface $batchItemRepository,
private BatchObjectManagerInterface $batchObjectManager,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions packages/EasyBatch/src/Common/Strategy/UuidStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

use EonX\EasyRandom\Generator\RandomGeneratorInterface;

final class UuidStrategy implements BatchObjectIdStrategyInterface
final readonly class UuidStrategy implements BatchObjectIdStrategyInterface
{
public function __construct(
private readonly RandomGeneratorInterface $randomGenerator,
private RandomGeneratorInterface $randomGenerator,
) {
}

Expand Down
12 changes: 6 additions & 6 deletions packages/EasyBatch/src/Common/ValueObject/BatchCounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

namespace EonX\EasyBatch\Common\ValueObject;

final class BatchCounts
final readonly class BatchCounts
{
public function __construct(
private readonly int $countCancelled,
private readonly int $countFailed,
private readonly int $countProcessed,
private readonly int $countSucceeded,
private readonly int $countTotal,
private int $countCancelled,
private int $countFailed,
private int $countProcessed,
private int $countSucceeded,
private int $countTotal,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
use EonX\EasyPagination\Paginator\LengthAwarePaginatorInterface;
use EonX\EasyPagination\ValueObject\Pagination;

final class BatchItemIterator implements BatchItemIteratorInterface
final readonly class BatchItemIterator implements BatchItemIteratorInterface
{
public function __construct(
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly int $batchItemsPerPage,
private BatchItemRepositoryInterface $batchItemRepository,
private int $batchItemsPerPage,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use EonX\EasyBatch\Messenger\Stamp\BatchItemStamp;
use Symfony\Component\Messenger\MessageBusInterface;

final class AsyncDispatcher implements AsyncDispatcherInterface
final readonly class AsyncDispatcher implements AsyncDispatcherInterface
{
public function __construct(
private readonly MessageBusInterface $bus,
private MessageBusInterface $bus,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
use Symfony\Component\Messenger\Transport\TransportInterface;
use Throwable;

final class BatchItemExceptionHandler
final readonly class BatchItemExceptionHandler
{
private const MESSENGER_TRANSPORT_PATTERN = 'messenger.transport.%s';

public function __construct(
private readonly BatchItemTransformer $batchItemTransformer,
private readonly ContainerInterface $container,
private readonly string $emergencyTransportName = 'async',
private BatchItemTransformer $batchItemTransformer,
private ContainerInterface $container,
private string $emergencyTransportName = 'async',
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use EonX\EasyLock\Common\ValueObject\LockDataInterface;
use Symfony\Component\Messenger\Envelope;

final class BatchItemLockFactory implements BatchItemLockFactoryInterface
final readonly class BatchItemLockFactory implements BatchItemLockFactoryInterface
{
public function __construct(
private readonly ?float $ttl = null,
private ?float $ttl = null,
) {
}

Expand Down
Loading