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 1 commit
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\Interfaces\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
16 changes: 8 additions & 8 deletions packages/EasyBatch/src/BatchObjectManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
use EonX\EasyBatch\Processors\BatchProcessor;
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 BatchItemIterator $batchItemIterator,
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly EventDispatcherInterface $eventDispatcher,
private BatchPersister $batchPersister,
private BatchRepositoryInterface $batchRepository,
private BatchProcessor $batchProcessor,
private BatchItemDispatcher $batchItemDispatcher,
private BatchItemIterator $batchItemIterator,
private BatchItemRepositoryInterface $batchItemRepository,
private EventDispatcherInterface $eventDispatcher,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
use EonX\EasyBatch\Interfaces\BatchItemInterface;
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 @@ -10,10 +10,10 @@
use Symfony\Component\Messenger\Middleware\StackInterface;
use Symfony\Component\Messenger\Stamp\ConsumedByWorkerStamp;

final class DispatchBatchMiddleware implements MiddlewareInterface
final readonly class DispatchBatchMiddleware implements MiddlewareInterface
{
public function __construct(
private readonly BatchObjectManagerInterface $batchObjectManager,
private BatchObjectManagerInterface $batchObjectManager,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
final class ProcessBatchForBatchItemHandler
final readonly class ProcessBatchForBatchItemHandler
{
public function __construct(
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly BatchObjectManagerInterface $batchObjectManager,
private readonly BatchProcessor $batchProcessor,
private readonly BatchRepositoryInterface $batchRepository,
private BatchItemRepositoryInterface $batchItemRepository,
private BatchObjectManagerInterface $batchObjectManager,
private BatchProcessor $batchProcessor,
private BatchRepositoryInterface $batchRepository,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

namespace EonX\EasyBatch\Bridge\Symfony\Messenger\Emergency;

final class ProcessBatchForBatchItemMessage
final readonly class ProcessBatchForBatchItemMessage
{
public function __construct(
private readonly int|string $batchItemId,
private readonly ?array $errorDetails = null,
private int|string $batchItemId,
private ?array $errorDetails = null,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
final class UpdateBatchItemHandler
final readonly class UpdateBatchItemHandler
{
public function __construct(
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly ProcessBatchForBatchItemHandler $processBatchForBatchItemHandler,
private BatchItemRepositoryInterface $batchItemRepository,
private ProcessBatchForBatchItemHandler $processBatchForBatchItemHandler,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use EonX\EasyLock\LockData;
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
use Symfony\Component\Messenger\Stamp\HandledStamp;
use Throwable;

final class ProcessBatchItemMiddleware implements MiddlewareInterface
final readonly class ProcessBatchItemMiddleware implements MiddlewareInterface
{
public function __construct(
private readonly BatchRepositoryInterface $batchRepository,
private readonly BatchItemExceptionHandler $batchItemExceptionHandler,
private readonly BatchItemRepositoryInterface $batchItemRepository,
private readonly BatchItemProcessor $batchItemProcessor,
private readonly BatchItemLockFactoryInterface $batchItemLockFactory,
private readonly BatchProcessor $batchProcessor,
private readonly LockServiceInterface $lockService,
private BatchRepositoryInterface $batchRepository,
private BatchItemExceptionHandler $batchItemExceptionHandler,
private BatchItemRepositoryInterface $batchItemRepository,
private BatchItemProcessor $batchItemProcessor,
private BatchItemLockFactoryInterface $batchItemLockFactory,
private BatchProcessor $batchProcessor,
private LockServiceInterface $lockService,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

use Symfony\Component\Messenger\Stamp\StampInterface;

final class BatchItemStamp implements StampInterface
final readonly class BatchItemStamp implements StampInterface
{
public function __construct(
private readonly int|string $batchItemId,
private int|string $batchItemId,
) {
}

Expand Down
10 changes: 5 additions & 5 deletions packages/EasyBatch/src/Dispatchers/BatchItemDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
use EonX\EasyBatch\Iterator\BatchItemIterator;
use EonX\EasyBatch\Iterator\IteratorConfig;

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

Expand Down
Loading