diff --git a/pkg/amqp-bunny/AmqpConsumer.php b/pkg/amqp-bunny/AmqpConsumer.php index f1b52a99d..6d17a3fc9 100644 --- a/pkg/amqp-bunny/AmqpConsumer.php +++ b/pkg/amqp-bunny/AmqpConsumer.php @@ -48,7 +48,7 @@ public function __construct(AmqpContext $context, InteropAmqpQueue $queue) $this->flags = self::FLAG_NOPARAM; } - public function setConsumerTag(string $consumerTag = null): void + public function setConsumerTag(?string $consumerTag = null): void { $this->consumerTag = $consumerTag; } diff --git a/pkg/amqp-bunny/AmqpProducer.php b/pkg/amqp-bunny/AmqpProducer.php index 76892ebeb..178ff81a8 100644 --- a/pkg/amqp-bunny/AmqpProducer.php +++ b/pkg/amqp-bunny/AmqpProducer.php @@ -79,7 +79,7 @@ public function send(Destination $destination, Message $message): void /** * @return self */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $this->delayStrategy) { throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt(); @@ -98,7 +98,7 @@ public function getDeliveryDelay(): ?int /** * @return self */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -113,7 +113,7 @@ public function getPriority(): ?int /** * @return self */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/amqp-ext/AmqpConsumer.php b/pkg/amqp-ext/AmqpConsumer.php index 03c949714..e5eb237a9 100644 --- a/pkg/amqp-ext/AmqpConsumer.php +++ b/pkg/amqp-ext/AmqpConsumer.php @@ -43,7 +43,7 @@ public function __construct(AmqpContext $context, InteropAmqpQueue $queue) $this->flags = self::FLAG_NOPARAM; } - public function setConsumerTag(string $consumerTag = null): void + public function setConsumerTag(?string $consumerTag = null): void { $this->consumerTag = $consumerTag; } diff --git a/pkg/amqp-ext/AmqpProducer.php b/pkg/amqp-ext/AmqpProducer.php index 0fe6b7a39..b9c15a4b4 100644 --- a/pkg/amqp-ext/AmqpProducer.php +++ b/pkg/amqp-ext/AmqpProducer.php @@ -72,7 +72,7 @@ public function send(Destination $destination, Message $message): void } } - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $this->delayStrategy) { throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt(); @@ -88,7 +88,7 @@ public function getDeliveryDelay(): ?int return $this->deliveryDelay; } - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -100,7 +100,7 @@ public function getPriority(): ?int return $this->priority; } - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/amqp-lib/AmqpConsumer.php b/pkg/amqp-lib/AmqpConsumer.php index 0218db6b2..bfef90072 100644 --- a/pkg/amqp-lib/AmqpConsumer.php +++ b/pkg/amqp-lib/AmqpConsumer.php @@ -47,7 +47,7 @@ public function __construct(AmqpContext $context, InteropAmqpQueue $queue) $this->flags = self::FLAG_NOPARAM; } - public function setConsumerTag(string $consumerTag = null): void + public function setConsumerTag(?string $consumerTag = null): void { $this->consumerTag = $consumerTag; } diff --git a/pkg/amqp-lib/AmqpProducer.php b/pkg/amqp-lib/AmqpProducer.php index 70e876793..928597298 100644 --- a/pkg/amqp-lib/AmqpProducer.php +++ b/pkg/amqp-lib/AmqpProducer.php @@ -81,7 +81,7 @@ public function send(Destination $destination, Message $message): void /** * @return self */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $this->delayStrategy) { throw DeliveryDelayNotSupportedException::providerDoestNotSupportIt(); @@ -100,7 +100,7 @@ public function getDeliveryDelay(): ?int /** * @return self */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -115,7 +115,7 @@ public function getPriority(): ?int /** * @return self */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/amqp-tools/DelayStrategyAware.php b/pkg/amqp-tools/DelayStrategyAware.php index f41a856a1..af488ce07 100644 --- a/pkg/amqp-tools/DelayStrategyAware.php +++ b/pkg/amqp-tools/DelayStrategyAware.php @@ -6,5 +6,5 @@ interface DelayStrategyAware { - public function setDelayStrategy(DelayStrategy $delayStrategy = null): self; + public function setDelayStrategy(?DelayStrategy $delayStrategy = null): self; } diff --git a/pkg/amqp-tools/DelayStrategyAwareTrait.php b/pkg/amqp-tools/DelayStrategyAwareTrait.php index 785f12895..b29f05797 100644 --- a/pkg/amqp-tools/DelayStrategyAwareTrait.php +++ b/pkg/amqp-tools/DelayStrategyAwareTrait.php @@ -11,7 +11,7 @@ trait DelayStrategyAwareTrait */ protected $delayStrategy; - public function setDelayStrategy(DelayStrategy $delayStrategy = null): DelayStrategyAware + public function setDelayStrategy(?DelayStrategy $delayStrategy = null): DelayStrategyAware { $this->delayStrategy = $delayStrategy; diff --git a/pkg/amqp-tools/Tests/RabbitMqDelayPluginDelayStrategyTest.php b/pkg/amqp-tools/Tests/RabbitMqDelayPluginDelayStrategyTest.php index de2b77ec5..d20506919 100644 --- a/pkg/amqp-tools/Tests/RabbitMqDelayPluginDelayStrategyTest.php +++ b/pkg/amqp-tools/Tests/RabbitMqDelayPluginDelayStrategyTest.php @@ -192,7 +192,7 @@ public function send(Destination $destination, Message $message): void { } - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { throw new \BadMethodCallException('This should not be called directly'); } @@ -202,7 +202,7 @@ public function getDeliveryDelay(): ?int throw new \BadMethodCallException('This should not be called directly'); } - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { throw new \BadMethodCallException('This should not be called directly'); } @@ -212,7 +212,7 @@ public function getPriority(): ?int throw new \BadMethodCallException('This should not be called directly'); } - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { throw new \BadMethodCallException('This should not be called directly'); } diff --git a/pkg/async-event-dispatcher/AsyncEventDispatcher.php b/pkg/async-event-dispatcher/AsyncEventDispatcher.php index fa7393ea6..e39136eff 100644 --- a/pkg/async-event-dispatcher/AsyncEventDispatcher.php +++ b/pkg/async-event-dispatcher/AsyncEventDispatcher.php @@ -4,7 +4,7 @@ class AsyncEventDispatcher extends AbstractAsyncEventDispatcher { - public function dispatch(object $event, string $eventName = null): object + public function dispatch(object $event, ?string $eventName = null): object { $this->parentDispatch($event, $eventName); diff --git a/pkg/async-event-dispatcher/EventTransformer.php b/pkg/async-event-dispatcher/EventTransformer.php index cee8635bd..186d07ade 100644 --- a/pkg/async-event-dispatcher/EventTransformer.php +++ b/pkg/async-event-dispatcher/EventTransformer.php @@ -12,7 +12,7 @@ interface EventTransformer * * @return Message */ - public function toMessage($eventName, Event $event = null); + public function toMessage($eventName, ?Event $event = null); /** * If you able to transform message back to event return it. diff --git a/pkg/async-event-dispatcher/PhpSerializerEventTransformer.php b/pkg/async-event-dispatcher/PhpSerializerEventTransformer.php index 1204e9591..9c23883aa 100644 --- a/pkg/async-event-dispatcher/PhpSerializerEventTransformer.php +++ b/pkg/async-event-dispatcher/PhpSerializerEventTransformer.php @@ -6,7 +6,7 @@ class PhpSerializerEventTransformer extends AbstractPhpSerializerEventTransformer implements EventTransformer { - public function toMessage($eventName, Event $event = null) + public function toMessage($eventName, ?Event $event = null) { return $this->context->createMessage(serialize($event)); } diff --git a/pkg/dbal/DbalConnectionFactory.php b/pkg/dbal/DbalConnectionFactory.php index 2e0fe702e..305375a89 100644 --- a/pkg/dbal/DbalConnectionFactory.php +++ b/pkg/dbal/DbalConnectionFactory.php @@ -92,7 +92,7 @@ private function establishConnection(): Connection return $this->connection; } - private function parseDsn(string $dsn, array $config = null): array + private function parseDsn(string $dsn, ?array $config = null): array { $parsedDsn = Dsn::parseFirst($dsn); diff --git a/pkg/dbal/DbalMessage.php b/pkg/dbal/DbalMessage.php index dc5435b17..7dd95e5f4 100644 --- a/pkg/dbal/DbalMessage.php +++ b/pkg/dbal/DbalMessage.php @@ -144,7 +144,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } @@ -159,7 +159,7 @@ public function getPriority(): ?int return $this->priority; } - public function setPriority(int $priority = null): void + public function setPriority(?int $priority = null): void { $this->priority = $priority; } @@ -172,7 +172,7 @@ public function getDeliveryDelay(): ?int /** * Set delay in milliseconds. */ - public function setDeliveryDelay(int $deliveryDelay = null): void + public function setDeliveryDelay(?int $deliveryDelay = null): void { $this->deliveryDelay = $deliveryDelay; } @@ -188,12 +188,12 @@ public function getTimeToLive(): ?int /** * Set time to live in milliseconds. */ - public function setTimeToLive(int $timeToLive = null): void + public function setTimeToLive(?int $timeToLive = null): void { $this->timeToLive = $timeToLive; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', $correlationId); } @@ -203,7 +203,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id', null); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', $messageId); } @@ -220,7 +220,7 @@ public function getTimestamp(): ?int return null === $value ? null : $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } @@ -240,7 +240,7 @@ public function getRedeliverAfter(): int return $this->redeliverAfter; } - public function setRedeliverAfter(int $redeliverAfter = null): void + public function setRedeliverAfter(?int $redeliverAfter = null): void { $this->redeliverAfter = $redeliverAfter; } @@ -250,7 +250,7 @@ public function getPublishedAt(): ?int return $this->publishedAt; } - public function setPublishedAt(int $publishedAt = null): void + public function setPublishedAt(?int $publishedAt = null): void { $this->publishedAt = $publishedAt; } diff --git a/pkg/dbal/DbalProducer.php b/pkg/dbal/DbalProducer.php index f0cdea849..e63524fb9 100644 --- a/pkg/dbal/DbalProducer.php +++ b/pkg/dbal/DbalProducer.php @@ -128,7 +128,7 @@ public function send(Destination $destination, Message $message): void } } - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { $this->deliveryDelay = $deliveryDelay; @@ -140,7 +140,7 @@ public function getDeliveryDelay(): ?int return $this->deliveryDelay; } - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -152,7 +152,7 @@ public function getPriority(): ?int return $this->priority; } - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/dbal/Tests/DbalConsumerTest.php b/pkg/dbal/Tests/DbalConsumerTest.php index d36333c83..29089412f 100644 --- a/pkg/dbal/Tests/DbalConsumerTest.php +++ b/pkg/dbal/Tests/DbalConsumerTest.php @@ -270,7 +270,7 @@ public function isRedelivered(): bool throw new \BadMethodCallException('This should not be called directly'); } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { } @@ -279,7 +279,7 @@ public function getCorrelationId(): ?string throw new \BadMethodCallException('This should not be called directly'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { } @@ -293,11 +293,11 @@ public function getTimestamp(): ?int throw new \BadMethodCallException('This should not be called directly'); } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { } diff --git a/pkg/dsn/Dsn.php b/pkg/dsn/Dsn.php index a5cc139b2..24b8f232e 100644 --- a/pkg/dsn/Dsn.php +++ b/pkg/dsn/Dsn.php @@ -140,27 +140,27 @@ public function getQuery(): array return $this->queryBag->toArray(); } - public function getString(string $name, string $default = null): ?string + public function getString(string $name, ?string $default = null): ?string { return $this->queryBag->getString($name, $default); } - public function getDecimal(string $name, int $default = null): ?int + public function getDecimal(string $name, ?int $default = null): ?int { return $this->queryBag->getDecimal($name, $default); } - public function getOctal(string $name, int $default = null): ?int + public function getOctal(string $name, ?int $default = null): ?int { return $this->queryBag->getOctal($name, $default); } - public function getFloat(string $name, float $default = null): ?float + public function getFloat(string $name, ?float $default = null): ?float { return $this->queryBag->getFloat($name, $default); } - public function getBool(string $name, bool $default = null): ?bool + public function getBool(string $name, ?bool $default = null): ?bool { return $this->queryBag->getBool($name, $default); } diff --git a/pkg/dsn/QueryBag.php b/pkg/dsn/QueryBag.php index 53d82b8ed..ea15aa854 100644 --- a/pkg/dsn/QueryBag.php +++ b/pkg/dsn/QueryBag.php @@ -21,12 +21,12 @@ public function toArray(): array return $this->query; } - public function getString(string $name, string $default = null): ?string + public function getString(string $name, ?string $default = null): ?string { return array_key_exists($name, $this->query) ? $this->query[$name] : $default; } - public function getDecimal(string $name, int $default = null): ?int + public function getDecimal(string $name, ?int $default = null): ?int { $value = $this->getString($name); if (null === $value) { @@ -40,7 +40,7 @@ public function getDecimal(string $name, int $default = null): ?int return (int) $value; } - public function getOctal(string $name, int $default = null): ?int + public function getOctal(string $name, ?int $default = null): ?int { $value = $this->getString($name); if (null === $value) { @@ -54,7 +54,7 @@ public function getOctal(string $name, int $default = null): ?int return intval($value, 8); } - public function getFloat(string $name, float $default = null): ?float + public function getFloat(string $name, ?float $default = null): ?float { $value = $this->getString($name); if (null === $value) { @@ -68,7 +68,7 @@ public function getFloat(string $name, float $default = null): ?float return (float) $value; } - public function getBool(string $name, bool $default = null): ?bool + public function getBool(string $name, ?bool $default = null): ?bool { $value = $this->getString($name); if (null === $value) { diff --git a/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncEventTransformer.php b/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncEventTransformer.php index 2a734682d..247e66b40 100644 --- a/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncEventTransformer.php +++ b/pkg/enqueue-bundle/Tests/Functional/App/TestAsyncEventTransformer.php @@ -21,7 +21,7 @@ public function __construct(Context $context) $this->context = $context; } - public function toMessage($eventName, Event $event = null) + public function toMessage($eventName, ?Event $event = null) { if (Event::class === get_class($event)) { return $this->context->createMessage(json_encode('')); diff --git a/pkg/enqueue/Client/Config.php b/pkg/enqueue/Client/Config.php index 888384207..9f83928db 100644 --- a/pkg/enqueue/Client/Config.php +++ b/pkg/enqueue/Client/Config.php @@ -153,13 +153,13 @@ public function getDriverOptions(): array } public static function create( - string $prefix = null, - string $separator = null, - string $app = null, - string $routerTopic = null, - string $routerQueue = null, - string $defaultQueue = null, - string $routerProcessor = null, + ?string $prefix = null, + ?string $separator = null, + ?string $app = null, + ?string $routerTopic = null, + ?string $routerQueue = null, + ?string $defaultQueue = null, + ?string $routerProcessor = null, array $transportConfig = [], array $driverConfig = [] ): self { diff --git a/pkg/enqueue/Client/Driver/AmqpDriver.php b/pkg/enqueue/Client/Driver/AmqpDriver.php index be62753bf..69d64f97b 100644 --- a/pkg/enqueue/Client/Driver/AmqpDriver.php +++ b/pkg/enqueue/Client/Driver/AmqpDriver.php @@ -58,7 +58,7 @@ public function createTransportMessage(Message $clientMessage): InteropMessage return $transportMessage; } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/DbalDriver.php b/pkg/enqueue/Client/Driver/DbalDriver.php index 8b1f32655..34875eff7 100644 --- a/pkg/enqueue/Client/Driver/DbalDriver.php +++ b/pkg/enqueue/Client/Driver/DbalDriver.php @@ -16,7 +16,7 @@ public function __construct(DbalContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/FsDriver.php b/pkg/enqueue/Client/Driver/FsDriver.php index 9de59c23b..d14b3215b 100644 --- a/pkg/enqueue/Client/Driver/FsDriver.php +++ b/pkg/enqueue/Client/Driver/FsDriver.php @@ -18,7 +18,7 @@ public function __construct(FsContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/GenericDriver.php b/pkg/enqueue/Client/Driver/GenericDriver.php index 529f6322c..539013493 100644 --- a/pkg/enqueue/Client/Driver/GenericDriver.php +++ b/pkg/enqueue/Client/Driver/GenericDriver.php @@ -120,7 +120,7 @@ public function sendToProcessor(Message $message): DriverSendResult return new DriverSendResult($queue, $transportMessage); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { } diff --git a/pkg/enqueue/Client/Driver/GpsDriver.php b/pkg/enqueue/Client/Driver/GpsDriver.php index 37a7110c1..32d14f721 100644 --- a/pkg/enqueue/Client/Driver/GpsDriver.php +++ b/pkg/enqueue/Client/Driver/GpsDriver.php @@ -20,7 +20,7 @@ public function __construct(GpsContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/MongodbDriver.php b/pkg/enqueue/Client/Driver/MongodbDriver.php index 19f2c57d3..1c9cff4bc 100644 --- a/pkg/enqueue/Client/Driver/MongodbDriver.php +++ b/pkg/enqueue/Client/Driver/MongodbDriver.php @@ -16,7 +16,7 @@ public function __construct(MongodbContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/RabbitMqStompDriver.php b/pkg/enqueue/Client/Driver/RabbitMqStompDriver.php index 36bdd86cf..7af2db850 100644 --- a/pkg/enqueue/Client/Driver/RabbitMqStompDriver.php +++ b/pkg/enqueue/Client/Driver/RabbitMqStompDriver.php @@ -62,7 +62,7 @@ public function createTransportMessage(Message $message): InteropMessage return $transportMessage; } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/RdKafkaDriver.php b/pkg/enqueue/Client/Driver/RdKafkaDriver.php index 37013bbe5..2609e3f91 100644 --- a/pkg/enqueue/Client/Driver/RdKafkaDriver.php +++ b/pkg/enqueue/Client/Driver/RdKafkaDriver.php @@ -19,7 +19,7 @@ public function __construct(RdKafkaContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $logger->debug('[RdKafkaDriver] setup broker'); diff --git a/pkg/enqueue/Client/Driver/SnsQsDriver.php b/pkg/enqueue/Client/Driver/SnsQsDriver.php index 2b1d4f233..f4bde10c2 100644 --- a/pkg/enqueue/Client/Driver/SnsQsDriver.php +++ b/pkg/enqueue/Client/Driver/SnsQsDriver.php @@ -19,7 +19,7 @@ public function __construct(SnsQsContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/SqsDriver.php b/pkg/enqueue/Client/Driver/SqsDriver.php index bf66c050c..49b696aae 100644 --- a/pkg/enqueue/Client/Driver/SqsDriver.php +++ b/pkg/enqueue/Client/Driver/SqsDriver.php @@ -18,7 +18,7 @@ public function __construct(SqsContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $log = function ($text, ...$args) use ($logger) { diff --git a/pkg/enqueue/Client/Driver/StompDriver.php b/pkg/enqueue/Client/Driver/StompDriver.php index 7040c71dd..811ad76e7 100644 --- a/pkg/enqueue/Client/Driver/StompDriver.php +++ b/pkg/enqueue/Client/Driver/StompDriver.php @@ -22,7 +22,7 @@ public function __construct(StompContext $context, ...$args) parent::__construct($context, ...$args); } - public function setupBroker(LoggerInterface $logger = null): void + public function setupBroker(?LoggerInterface $logger = null): void { $logger = $logger ?: new NullLogger(); $logger->debug('[StompDriver] Stomp protocol does not support broker configuration'); diff --git a/pkg/enqueue/Client/Driver/StompManagementClient.php b/pkg/enqueue/Client/Driver/StompManagementClient.php index c068a57df..5880672b5 100644 --- a/pkg/enqueue/Client/Driver/StompManagementClient.php +++ b/pkg/enqueue/Client/Driver/StompManagementClient.php @@ -37,7 +37,7 @@ public function declareExchange(string $name, array $options) return $this->client->exchanges()->create($this->vhost, $name, $options); } - public function bind(string $exchange, string $queue, string $routingKey = null, $arguments = null) + public function bind(string $exchange, string $queue, ?string $routingKey = null, $arguments = null) { return $this->client->bindings()->create($this->vhost, $exchange, $queue, $routingKey, $arguments); } diff --git a/pkg/enqueue/Client/DriverInterface.php b/pkg/enqueue/Client/DriverInterface.php index 1832e0f9a..9d1dde679 100644 --- a/pkg/enqueue/Client/DriverInterface.php +++ b/pkg/enqueue/Client/DriverInterface.php @@ -27,7 +27,7 @@ public function createRouteQueue(Route $route): InteropQueue; * Prepare broker for work. * Creates all required queues, exchanges, topics, bindings etc. */ - public function setupBroker(LoggerInterface $logger = null): void; + public function setupBroker(?LoggerInterface $logger = null): void; public function getConfig(): Config; diff --git a/pkg/enqueue/Client/PreSend.php b/pkg/enqueue/Client/PreSend.php index afd64012f..5d2255677 100644 --- a/pkg/enqueue/Client/PreSend.php +++ b/pkg/enqueue/Client/PreSend.php @@ -48,7 +48,7 @@ public function changeTopic(string $newTopic): void $this->commandOrTopic = $newTopic; } - public function changeBody($body, string $contentType = null): void + public function changeBody($body, ?string $contentType = null): void { $this->message->setBody($body); diff --git a/pkg/enqueue/Client/Producer.php b/pkg/enqueue/Client/Producer.php index 6ea612b8c..59ec9f51f 100644 --- a/pkg/enqueue/Client/Producer.php +++ b/pkg/enqueue/Client/Producer.php @@ -27,7 +27,7 @@ final class Producer implements ProducerInterface public function __construct( DriverInterface $driver, RpcFactory $rpcFactory, - ExtensionInterface $extension = null + ?ExtensionInterface $extension = null ) { $this->driver = $driver; $this->rpcFactory = $rpcFactory; diff --git a/pkg/enqueue/Client/TraceableProducer.php b/pkg/enqueue/Client/TraceableProducer.php index 59b0c7b01..b0bd613c3 100644 --- a/pkg/enqueue/Client/TraceableProducer.php +++ b/pkg/enqueue/Client/TraceableProducer.php @@ -71,7 +71,7 @@ public function clearTraces(): void $this->traces = []; } - private function collectTrace(string $topic = null, string $command = null, $message): void + private function collectTrace(?string $topic, ?string $command, $message): void { $trace = [ 'topic' => $topic, diff --git a/pkg/enqueue/Consumption/QueueConsumer.php b/pkg/enqueue/Consumption/QueueConsumer.php index 80936bf58..b47e960bf 100644 --- a/pkg/enqueue/Consumption/QueueConsumer.php +++ b/pkg/enqueue/Consumption/QueueConsumer.php @@ -63,9 +63,9 @@ final class QueueConsumer implements QueueConsumerInterface */ public function __construct( InteropContext $interopContext, - ExtensionInterface $extension = null, + ?ExtensionInterface $extension = null, array $boundProcessors = [], - LoggerInterface $logger = null, + ?LoggerInterface $logger = null, int $receiveTimeout = 10000 ) { $this->interopContext = $interopContext; @@ -122,7 +122,7 @@ public function bindCallback($queue, callable $processor): QueueConsumerInterfac return $this->bind($queue, new CallbackProcessor($processor)); } - public function consume(ExtensionInterface $runtimeExtension = null): void + public function consume(?ExtensionInterface $runtimeExtension = null): void { $extension = $runtimeExtension ? new ChainExtension([$this->staticExtension, $runtimeExtension]) : @@ -286,7 +286,7 @@ public function setFallbackSubscriptionConsumer(SubscriptionConsumer $fallbackSu $this->fallbackSubscriptionConsumer = $fallbackSubscriptionConsumer; } - private function onEnd(ExtensionInterface $extension, int $startTime, ?int $exitStatus = null, SubscriptionConsumer $subscriptionConsumer = null): void + private function onEnd(ExtensionInterface $extension, int $startTime, ?int $exitStatus = null, ?SubscriptionConsumer $subscriptionConsumer = null): void { $endTime = (int) (microtime(true) * 1000); diff --git a/pkg/enqueue/Consumption/QueueConsumerInterface.php b/pkg/enqueue/Consumption/QueueConsumerInterface.php index 430aa8786..ef6752d59 100644 --- a/pkg/enqueue/Consumption/QueueConsumerInterface.php +++ b/pkg/enqueue/Consumption/QueueConsumerInterface.php @@ -38,5 +38,5 @@ public function bindCallback($queueName, callable $processor): self; * * @throws \Exception */ - public function consume(ExtensionInterface $runtimeExtension = null): void; + public function consume(?ExtensionInterface $runtimeExtension = null): void; } diff --git a/pkg/enqueue/Consumption/Result.php b/pkg/enqueue/Consumption/Result.php index c5659bc92..76ecf8931 100644 --- a/pkg/enqueue/Consumption/Result.php +++ b/pkg/enqueue/Consumption/Result.php @@ -84,7 +84,7 @@ public function getReply() /** * @param InteropMessage|null $reply */ - public function setReply(InteropMessage $reply = null) + public function setReply(?InteropMessage $reply = null) { $this->reply = $reply; } diff --git a/pkg/enqueue/Rpc/RpcClient.php b/pkg/enqueue/Rpc/RpcClient.php index 591a4cc19..b6ae8821e 100644 --- a/pkg/enqueue/Rpc/RpcClient.php +++ b/pkg/enqueue/Rpc/RpcClient.php @@ -23,7 +23,7 @@ class RpcClient * @param Context $context * @param RpcFactory $promiseFactory */ - public function __construct(Context $context, RpcFactory $promiseFactory = null) + public function __construct(Context $context, ?RpcFactory $promiseFactory = null) { $this->context = $context; $this->rpcFactory = $promiseFactory ?: new RpcFactory($context); diff --git a/pkg/enqueue/Tests/Consumption/QueueConsumerTest.php b/pkg/enqueue/Tests/Consumption/QueueConsumerTest.php index ecf7f9afa..295138b69 100644 --- a/pkg/enqueue/Tests/Consumption/QueueConsumerTest.php +++ b/pkg/enqueue/Tests/Consumption/QueueConsumerTest.php @@ -1470,7 +1470,7 @@ private function createContextWithoutSubscriptionConsumerMock(): InteropContext /** * @return \PHPUnit\Framework\MockObject\MockObject|InteropContext */ - private function createContextStub(Consumer $consumer = null): InteropContext + private function createContextStub(?Consumer $consumer = null): InteropContext { $context = $this->createContextWithoutSubscriptionConsumerMock(); $context diff --git a/pkg/fs/FsMessage.php b/pkg/fs/FsMessage.php index d66ee52cd..85b5f7dbd 100644 --- a/pkg/fs/FsMessage.php +++ b/pkg/fs/FsMessage.php @@ -96,7 +96,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', (string) $correlationId); } @@ -106,7 +106,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', (string) $messageId); } @@ -123,12 +123,12 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } diff --git a/pkg/fs/FsProducer.php b/pkg/fs/FsProducer.php index 55ff88cc3..af2b723f1 100644 --- a/pkg/fs/FsProducer.php +++ b/pkg/fs/FsProducer.php @@ -67,7 +67,7 @@ public function send(Destination $destination, Message $message): void }); } - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $deliveryDelay) { return $this; @@ -81,7 +81,7 @@ public function getDeliveryDelay(): ?int return null; } - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (null === $priority) { return $this; @@ -95,7 +95,7 @@ public function getPriority(): ?int return null; } - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/gearman/GearmanMessage.php b/pkg/gearman/GearmanMessage.php index 625566d62..529ea0b88 100644 --- a/pkg/gearman/GearmanMessage.php +++ b/pkg/gearman/GearmanMessage.php @@ -101,7 +101,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', (string) $correlationId); } @@ -111,7 +111,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', (string) $messageId); } @@ -128,12 +128,12 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } @@ -171,7 +171,7 @@ public function getJob(): ?\GearmanJob return $this->job; } - public function setJob(\GearmanJob $job = null): void + public function setJob(?\GearmanJob $job = null): void { $this->job = $job; } diff --git a/pkg/gearman/GearmanProducer.php b/pkg/gearman/GearmanProducer.php index c297e71b2..870bdcb03 100644 --- a/pkg/gearman/GearmanProducer.php +++ b/pkg/gearman/GearmanProducer.php @@ -40,7 +40,7 @@ public function send(Destination $destination, Message $message): void } } - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $deliveryDelay) { return $this; @@ -54,7 +54,7 @@ public function getDeliveryDelay(): ?int return null; } - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (null === $priority) { return $this; @@ -68,7 +68,7 @@ public function getPriority(): ?int return null; } - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { if (null === $timeToLive) { return $this; diff --git a/pkg/job-queue/Doctrine/JobStorage.php b/pkg/job-queue/Doctrine/JobStorage.php index 0ee459e50..a117d6b3c 100644 --- a/pkg/job-queue/Doctrine/JobStorage.php +++ b/pkg/job-queue/Doctrine/JobStorage.php @@ -124,7 +124,7 @@ public function createJob() /** * @throws DuplicateJobException */ - public function saveJob(Job $job, \Closure $lockCallback = null) + public function saveJob(Job $job, ?\Closure $lockCallback = null) { $class = $this->getEntityRepository()->getClassName(); if (!$job instanceof $class) { diff --git a/pkg/job-queue/JobRunner.php b/pkg/job-queue/JobRunner.php index e8d7eaa27..86960deb0 100644 --- a/pkg/job-queue/JobRunner.php +++ b/pkg/job-queue/JobRunner.php @@ -17,7 +17,7 @@ class JobRunner /** * @param Job $rootJob */ - public function __construct(JobProcessor $jobProcessor, Job $rootJob = null) + public function __construct(JobProcessor $jobProcessor, ?Job $rootJob = null) { $this->jobProcessor = $jobProcessor; $this->rootJob = $rootJob; diff --git a/pkg/mongodb/MongodbMessage.php b/pkg/mongodb/MongodbMessage.php index fbfbd75d6..fadc5dd4e 100644 --- a/pkg/mongodb/MongodbMessage.php +++ b/pkg/mongodb/MongodbMessage.php @@ -65,7 +65,7 @@ public function __construct(string $body = '', array $properties = [], array $he $this->redelivered = false; } - public function setId(string $id = null): void + public function setId(?string $id = null): void { $this->id = $id; } @@ -135,7 +135,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } @@ -150,7 +150,7 @@ public function getPriority(): ?int return $this->priority; } - public function setPriority(int $priority = null): void + public function setPriority(?int $priority = null): void { $this->priority = $priority; } @@ -163,7 +163,7 @@ public function getDeliveryDelay(): ?int /** * In milliseconds. */ - public function setDeliveryDelay(int $deliveryDelay = null): void + public function setDeliveryDelay(?int $deliveryDelay = null): void { $this->deliveryDelay = $deliveryDelay; } @@ -176,12 +176,12 @@ public function getTimeToLive(): ?int /** * In milliseconds. */ - public function setTimeToLive(int $timeToLive = null): void + public function setTimeToLive(?int $timeToLive = null): void { $this->timeToLive = $timeToLive; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', $correlationId); } @@ -191,7 +191,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id', null); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', $messageId); } @@ -208,7 +208,7 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } @@ -221,7 +221,7 @@ public function getPublishedAt(): ?int /** * In milliseconds. */ - public function setPublishedAt(int $publishedAt = null): void + public function setPublishedAt(?int $publishedAt = null): void { $this->publishedAt = $publishedAt; } diff --git a/pkg/mongodb/MongodbProducer.php b/pkg/mongodb/MongodbProducer.php index d26696cf8..34f360be9 100644 --- a/pkg/mongodb/MongodbProducer.php +++ b/pkg/mongodb/MongodbProducer.php @@ -111,7 +111,7 @@ public function send(Destination $destination, Message $message): void /** * @return self */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { $this->deliveryDelay = $deliveryDelay; @@ -126,7 +126,7 @@ public function getDeliveryDelay(): ?int /** * @return self */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -141,7 +141,7 @@ public function getPriority(): ?int /** * @return self */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/mongodb/Tests/MongodbConsumerTest.php b/pkg/mongodb/Tests/MongodbConsumerTest.php index cd2ee06f8..ed6447153 100644 --- a/pkg/mongodb/Tests/MongodbConsumerTest.php +++ b/pkg/mongodb/Tests/MongodbConsumerTest.php @@ -183,7 +183,7 @@ public function isRedelivered(): bool throw new \BadMethodCallException('This should not be called directly'); } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { } @@ -192,7 +192,7 @@ public function getCorrelationId(): ?string throw new \BadMethodCallException('This should not be called directly'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { } @@ -206,11 +206,11 @@ public function getTimestamp(): ?int throw new \BadMethodCallException('This should not be called directly'); } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { } diff --git a/pkg/monitoring/ConsumedMessageStats.php b/pkg/monitoring/ConsumedMessageStats.php index 928bce0de..f82aa142e 100644 --- a/pkg/monitoring/ConsumedMessageStats.php +++ b/pkg/monitoring/ConsumedMessageStats.php @@ -102,12 +102,12 @@ public function __construct( array $properties, bool $redelivered, string $status, - string $errorClass = null, - string $errorMessage = null, - int $errorCode = null, - string $errorFile = null, - int $errorLine = null, - string $trace = null + ?string $errorClass = null, + ?string $errorMessage = null, + ?int $errorCode = null, + ?string $errorFile = null, + ?int $errorLine = null, + ?string $trace = null ) { $this->consumerId = $consumerId; $this->timestampMs = $timestampMs; diff --git a/pkg/monitoring/ConsumerStats.php b/pkg/monitoring/ConsumerStats.php index d1a745d14..b4e1d33e1 100644 --- a/pkg/monitoring/ConsumerStats.php +++ b/pkg/monitoring/ConsumerStats.php @@ -121,12 +121,12 @@ public function __construct( int $requeued, int $memoryUsage, float $systemLoad, - string $errorClass = null, - string $errorMessage = null, - int $errorCode = null, - string $errorFile = null, - int $errorLine = null, - string $trace = null + ?string $errorClass = null, + ?string $errorMessage = null, + ?int $errorCode = null, + ?string $errorFile = null, + ?int $errorLine = null, + ?string $trace = null ) { $this->consumerId = $consumerId; $this->timestampMs = $timestampMs; diff --git a/pkg/null/NullMessage.php b/pkg/null/NullMessage.php index bd48a387e..93fc57c3d 100644 --- a/pkg/null/NullMessage.php +++ b/pkg/null/NullMessage.php @@ -97,7 +97,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $headers = $this->getHeaders(); $headers['correlation_id'] = (string) $correlationId; @@ -110,7 +110,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $headers = $this->getHeaders(); $headers['message_id'] = (string) $messageId; @@ -130,7 +130,7 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $headers = $this->getHeaders(); $headers['timestamp'] = (int) $timestamp; @@ -138,7 +138,7 @@ public function setTimestamp(int $timestamp = null): void $this->setHeaders($headers); } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } diff --git a/pkg/null/NullProducer.php b/pkg/null/NullProducer.php index 47235e7f6..1349de9ba 100644 --- a/pkg/null/NullProducer.php +++ b/pkg/null/NullProducer.php @@ -23,7 +23,7 @@ public function send(Destination $destination, Message $message): void /** * @return NullProducer */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { $this->deliveryDelay = $deliveryDelay; @@ -38,7 +38,7 @@ public function getDeliveryDelay(): ?int /** * @return NullProducer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -53,7 +53,7 @@ public function getPriority(): ?int /** * @return NullProducer */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/pheanstalk/PheanstalkMessage.php b/pkg/pheanstalk/PheanstalkMessage.php index cf4ea1905..d7a43404e 100644 --- a/pkg/pheanstalk/PheanstalkMessage.php +++ b/pkg/pheanstalk/PheanstalkMessage.php @@ -103,7 +103,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', (string) $correlationId); } @@ -113,7 +113,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', (string) $messageId); } @@ -130,12 +130,12 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } @@ -203,7 +203,7 @@ public function getJob(): ?Job return $this->job; } - public function setJob(Job $job = null): void + public function setJob(?Job $job = null): void { $this->job = $job; } diff --git a/pkg/pheanstalk/PheanstalkProducer.php b/pkg/pheanstalk/PheanstalkProducer.php index 030beedf8..bd520b32d 100644 --- a/pkg/pheanstalk/PheanstalkProducer.php +++ b/pkg/pheanstalk/PheanstalkProducer.php @@ -73,7 +73,7 @@ public function send(Destination $destination, Message $message): void /** * @return PheanstalkProducer */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { $this->deliveryDelay = $deliveryDelay; @@ -88,7 +88,7 @@ public function getDeliveryDelay(): ?int /** * @return PheanstalkProducer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->priority = $priority; @@ -103,7 +103,7 @@ public function getPriority(): ?int /** * @return PheanstalkProducer */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/rdkafka/RdKafkaConsumer.php b/pkg/rdkafka/RdKafkaConsumer.php index 7fbaef755..b1e9ad555 100644 --- a/pkg/rdkafka/RdKafkaConsumer.php +++ b/pkg/rdkafka/RdKafkaConsumer.php @@ -71,7 +71,7 @@ public function getOffset(): ?int return $this->offset; } - public function setOffset(int $offset = null): void + public function setOffset(?int $offset = null): void { if ($this->subscribed) { throw new \LogicException('The consumer has already subscribed.'); diff --git a/pkg/rdkafka/RdKafkaMessage.php b/pkg/rdkafka/RdKafkaMessage.php index 0785a5644..7c6d0d005 100644 --- a/pkg/rdkafka/RdKafkaMessage.php +++ b/pkg/rdkafka/RdKafkaMessage.php @@ -112,7 +112,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', (string) $correlationId); } @@ -122,7 +122,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', (string) $messageId); } @@ -139,12 +139,12 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } @@ -159,7 +159,7 @@ public function getPartition(): ?int return $this->partition; } - public function setPartition(int $partition = null): void + public function setPartition(?int $partition = null): void { $this->partition = $partition; } @@ -169,7 +169,7 @@ public function getKey(): ?string return $this->key; } - public function setKey(string $key = null): void + public function setKey(?string $key = null): void { $this->key = $key; } @@ -179,7 +179,7 @@ public function getKafkaMessage(): ?VendorMessage return $this->kafkaMessage; } - public function setKafkaMessage(VendorMessage $message = null): void + public function setKafkaMessage(?VendorMessage $message = null): void { $this->kafkaMessage = $message; } diff --git a/pkg/rdkafka/RdKafkaProducer.php b/pkg/rdkafka/RdKafkaProducer.php index 64b9ea3a7..8d0056d77 100644 --- a/pkg/rdkafka/RdKafkaProducer.php +++ b/pkg/rdkafka/RdKafkaProducer.php @@ -70,7 +70,7 @@ public function send(Destination $destination, Message $message): void /** * @return RdKafkaProducer */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $deliveryDelay) { return $this; @@ -87,7 +87,7 @@ public function getDeliveryDelay(): ?int /** * @return RdKafkaProducer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (null === $priority) { return $this; @@ -101,7 +101,7 @@ public function getPriority(): ?int return null; } - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { if (null === $timeToLive) { return $this; diff --git a/pkg/rdkafka/RdKafkaTopic.php b/pkg/rdkafka/RdKafkaTopic.php index a7bde1021..572f4d024 100644 --- a/pkg/rdkafka/RdKafkaTopic.php +++ b/pkg/rdkafka/RdKafkaTopic.php @@ -50,7 +50,7 @@ public function getConf(): ?TopicConf return $this->conf; } - public function setConf(TopicConf $conf = null): void + public function setConf(?TopicConf $conf = null): void { $this->conf = $conf; } @@ -60,7 +60,7 @@ public function getPartition(): ?int return $this->partition; } - public function setPartition(int $partition = null): void + public function setPartition(?int $partition = null): void { $this->partition = $partition; } @@ -70,7 +70,7 @@ public function getKey(): ?string return $this->key; } - public function setKey(string $key = null): void + public function setKey(?string $key = null): void { $this->key = $key; } diff --git a/pkg/redis/RedisMessage.php b/pkg/redis/RedisMessage.php index 74c65475a..f647bfe9f 100644 --- a/pkg/redis/RedisMessage.php +++ b/pkg/redis/RedisMessage.php @@ -107,7 +107,7 @@ public function isRedelivered(): bool return $this->redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', $correlationId); } @@ -117,7 +117,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', $messageId); } @@ -134,12 +134,12 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } @@ -168,7 +168,7 @@ public function getTimeToLive(): ?int /** * Set time to live in milliseconds. */ - public function setTimeToLive(int $timeToLive = null): void + public function setTimeToLive(?int $timeToLive = null): void { $this->setHeader('time_to_live', $timeToLive); } @@ -181,7 +181,7 @@ public function getDeliveryDelay(): ?int /** * Set delay in milliseconds. */ - public function setDeliveryDelay(int $deliveryDelay = null): void + public function setDeliveryDelay(?int $deliveryDelay = null): void { $this->setHeader('delivery_delay', $deliveryDelay); } diff --git a/pkg/redis/RedisProducer.php b/pkg/redis/RedisProducer.php index cc7d63230..07aacc0cf 100644 --- a/pkg/redis/RedisProducer.php +++ b/pkg/redis/RedisProducer.php @@ -74,7 +74,7 @@ public function send(Destination $destination, Message $message): void /** * @return self */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { $this->deliveryDelay = $deliveryDelay; @@ -89,7 +89,7 @@ public function getDeliveryDelay(): ?int /** * @return RedisProducer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (null === $priority) { return $this; @@ -106,7 +106,7 @@ public function getPriority(): ?int /** * @return self */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->timeToLive = $timeToLive; diff --git a/pkg/simple-client/SimpleClient.php b/pkg/simple-client/SimpleClient.php index 9158364b9..61c844238 100644 --- a/pkg/simple-client/SimpleClient.php +++ b/pkg/simple-client/SimpleClient.php @@ -117,7 +117,7 @@ final class SimpleClient * * @param string|array $config */ - public function __construct($config, LoggerInterface $logger = null) + public function __construct($config, ?LoggerInterface $logger = null) { if (is_string($config)) { $config = [ @@ -134,7 +134,7 @@ public function __construct($config, LoggerInterface $logger = null) /** * @param callable|Processor $processor */ - public function bindTopic(string $topic, $processor, string $processorName = null): void + public function bindTopic(string $topic, $processor, ?string $processorName = null): void { if (is_callable($processor)) { $processor = new CallbackProcessor($processor); @@ -153,7 +153,7 @@ public function bindTopic(string $topic, $processor, string $processorName = nul /** * @param callable|Processor $processor */ - public function bindCommand(string $command, $processor, string $processorName = null): void + public function bindCommand(string $command, $processor, ?string $processorName = null): void { if (is_callable($processor)) { $processor = new CallbackProcessor($processor); @@ -185,7 +185,7 @@ public function sendEvent(string $topic, $message): void $this->producer->sendEvent($topic, $message); } - public function consume(ExtensionInterface $runtimeExtension = null): void + public function consume(?ExtensionInterface $runtimeExtension = null): void { $this->setupBroker(); diff --git a/pkg/sns/SnsDestination.php b/pkg/sns/SnsDestination.php index 5823fd91e..adcb08f43 100644 --- a/pkg/sns/SnsDestination.php +++ b/pkg/sns/SnsDestination.php @@ -34,7 +34,7 @@ public function getTopicName(): string /** * The policy that defines who can access your topic. By default, only the topic owner can publish or subscribe to the topic. */ - public function setPolicy(string $policy = null): void + public function setPolicy(?string $policy = null): void { $this->setAttribute('Policy', $policy); } @@ -47,7 +47,7 @@ public function getPolicy(): ?string /** * The display name to use for a topic with SMS subscriptions. */ - public function setDisplayName(string $displayName = null): void + public function setDisplayName(?string $displayName = null): void { $this->setAttribute('DisplayName', $displayName); } @@ -60,7 +60,7 @@ public function getDisplayName(): ?string /** * The display name to use for a topic with SMS subscriptions. */ - public function setDeliveryPolicy(int $deliveryPolicy = null): void + public function setDeliveryPolicy(?int $deliveryPolicy = null): void { $this->setAttribute('DeliveryPolicy', $deliveryPolicy); } diff --git a/pkg/sns/SnsMessage.php b/pkg/sns/SnsMessage.php index 43c85e553..c41f5c5d1 100644 --- a/pkg/sns/SnsMessage.php +++ b/pkg/sns/SnsMessage.php @@ -63,11 +63,11 @@ public function __construct( string $body = '', array $properties = [], array $headers = [], - array $messageAttributes = null, - string $messageStructure = null, - string $phoneNumber = null, - string $subject = null, - string $targetArn = null + ?array $messageAttributes = null, + ?string $messageStructure = null, + ?string $phoneNumber = null, + ?string $subject = null, + ?string $targetArn = null ) { $this->body = $body; $this->properties = $properties; @@ -192,7 +192,7 @@ public function setTargetArn(?string $targetArn): void * of each user is processed in a FIFO fashion. * For more information, see: https://docs.aws.amazon.com/sns/latest/dg/fifo-message-grouping.html */ - public function setMessageGroupId(string $id = null): void + public function setMessageGroupId(?string $id = null): void { $this->messageGroupId = $id; } @@ -210,7 +210,7 @@ public function getMessageGroupId(): ?string * aren't delivered during the 5-minute deduplication interval. * For more information, see https://docs.aws.amazon.com/sns/latest/dg/fifo-message-dedup.html */ - public function setMessageDeduplicationId(string $id = null): void + public function setMessageDeduplicationId(?string $id = null): void { $this->messageDeduplicationId = $id; } diff --git a/pkg/sns/SnsProducer.php b/pkg/sns/SnsProducer.php index bbd46a96f..ac7e38b5b 100644 --- a/pkg/sns/SnsProducer.php +++ b/pkg/sns/SnsProducer.php @@ -99,7 +99,7 @@ public function send(Destination $destination, Message $message): void * * @return SnsProducer */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $deliveryDelay) { return $this; @@ -118,7 +118,7 @@ public function getDeliveryDelay(): ?int * * @return SnsProducer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (null === $priority) { return $this; @@ -137,7 +137,7 @@ public function getPriority(): ?int * * @return SnsProducer */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { if (null === $timeToLive) { return $this; diff --git a/pkg/snsqs/SnsQsConsumer.php b/pkg/snsqs/SnsQsConsumer.php index 17ec39ae0..45237d145 100644 --- a/pkg/snsqs/SnsQsConsumer.php +++ b/pkg/snsqs/SnsQsConsumer.php @@ -44,7 +44,7 @@ public function getVisibilityTimeout(): ?int * The duration (in seconds) that the received messages are hidden from subsequent retrieve * requests after being retrieved by a ReceiveMessage request. */ - public function setVisibilityTimeout(int $visibilityTimeout = null): void + public function setVisibilityTimeout(?int $visibilityTimeout = null): void { $this->consumer->setVisibilityTimeout($visibilityTimeout); } diff --git a/pkg/snsqs/SnsQsMessage.php b/pkg/snsqs/SnsQsMessage.php index c804b1860..10999e0eb 100644 --- a/pkg/snsqs/SnsQsMessage.php +++ b/pkg/snsqs/SnsQsMessage.php @@ -41,7 +41,7 @@ public function __construct( string $body = '', array $properties = [], array $headers = [], - array $messageAttributes = null + ?array $messageAttributes = null ) { $this->body = $body; $this->properties = $properties; @@ -77,7 +77,7 @@ public function setMessageAttributes(?array $messageAttributes): void * any messages sent with the same MessageDeduplicationId are accepted successfully but aren't delivered during the 5-minute * deduplication interval. For more information, see http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing. */ - public function setMessageDeduplicationId(string $id = null): void + public function setMessageDeduplicationId(?string $id = null): void { $this->messageDeduplicationId = $id; } @@ -96,7 +96,7 @@ public function getMessageDeduplicationId(): ?string * for multiple users). In this scenario, multiple readers can process the queue, but the session data * of each user is processed in a FIFO fashion. */ - public function setMessageGroupId(string $id = null): void + public function setMessageGroupId(?string $id = null): void { $this->messageGroupId = $id; } diff --git a/pkg/snsqs/SnsQsProducer.php b/pkg/snsqs/SnsQsProducer.php index 6bc66e8f8..936992118 100644 --- a/pkg/snsqs/SnsQsProducer.php +++ b/pkg/snsqs/SnsQsProducer.php @@ -82,7 +82,7 @@ public function send(Destination $destination, Message $message): void /** * Delivery delay is supported by SQSProducer. */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { $this->getSqsProducer()->setDeliveryDelay($deliveryDelay); @@ -97,7 +97,7 @@ public function getDeliveryDelay(): ?int return $this->getSqsProducer()->getDeliveryDelay(); } - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { $this->getSnsProducer()->setPriority($priority); $this->getSqsProducer()->setPriority($priority); @@ -110,7 +110,7 @@ public function getPriority(): ?int return $this->getSnsProducer()->getPriority(); } - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { $this->getSnsProducer()->setTimeToLive($timeToLive); $this->getSqsProducer()->setTimeToLive($timeToLive); diff --git a/pkg/sqs/SqsConsumer.php b/pkg/sqs/SqsConsumer.php index 04d5bbd81..860bc648b 100644 --- a/pkg/sqs/SqsConsumer.php +++ b/pkg/sqs/SqsConsumer.php @@ -53,7 +53,7 @@ public function getVisibilityTimeout(): ?int * The duration (in seconds) that the received messages are hidden from subsequent retrieve * requests after being retrieved by a ReceiveMessage request. */ - public function setVisibilityTimeout(int $visibilityTimeout = null): void + public function setVisibilityTimeout(?int $visibilityTimeout = null): void { $this->visibilityTimeout = $visibilityTimeout; } diff --git a/pkg/sqs/SqsDestination.php b/pkg/sqs/SqsDestination.php index 5649d30a3..d77966f15 100644 --- a/pkg/sqs/SqsDestination.php +++ b/pkg/sqs/SqsDestination.php @@ -62,7 +62,7 @@ public function getAttributes(): array * The number of seconds for which the delivery of all messages in the queue is delayed. * Valid values: An integer from 0 to 900 seconds (15 minutes). The default is 0 (zero). */ - public function setDelaySeconds(int $seconds = null): void + public function setDelaySeconds(?int $seconds = null): void { if (null == $seconds) { unset($this->attributes['DelaySeconds']); @@ -76,7 +76,7 @@ public function setDelaySeconds(int $seconds = null): void * Valid values: An integer from 1,024 bytes (1 KiB) to 262,144 bytes (256 KiB). * The default is 262,144 (256 KiB). */ - public function setMaximumMessageSize(int $bytes = null): void + public function setMaximumMessageSize(?int $bytes = null): void { if (null == $bytes) { unset($this->attributes['MaximumMessageSize']); @@ -90,7 +90,7 @@ public function setMaximumMessageSize(int $bytes = null): void * Valid values: An integer from 60 seconds (1 minute) to 1,209,600 seconds (14 days). * The default is 345,600 (4 days). */ - public function setMessageRetentionPeriod(int $seconds = null): void + public function setMessageRetentionPeriod(?int $seconds = null): void { if (null == $seconds) { unset($this->attributes['MessageRetentionPeriod']); @@ -103,7 +103,7 @@ public function setMessageRetentionPeriod(int $seconds = null): void * The queue's policy. A valid AWS policy. For more information about policy structure, * see http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html. */ - public function setPolicy(string $policy = null): void + public function setPolicy(?string $policy = null): void { if (null == $policy) { unset($this->attributes['Policy']); @@ -116,7 +116,7 @@ public function setPolicy(string $policy = null): void * The number of seconds for which a ReceiveMessage action waits for a message to arrive. * Valid values: An integer from 0 to 20 (seconds). The default is 0 (zero). */ - public function setReceiveMessageWaitTimeSeconds(int $seconds = null): void + public function setReceiveMessageWaitTimeSeconds(?int $seconds = null): void { if (null == $seconds) { unset($this->attributes['ReceiveMessageWaitTimeSeconds']); @@ -145,7 +145,7 @@ public function setRedrivePolicy(int $maxReceiveCount, string $deadLetterTargetA * The default is 30. For more information about the visibility timeout, * see http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html. */ - public function setVisibilityTimeout(int $seconds = null): void + public function setVisibilityTimeout(?int $seconds = null): void { if (null == $seconds) { unset($this->attributes['VisibilityTimeout']); @@ -208,7 +208,7 @@ public function setQueueOwnerAWSAccountId(?string $queueOwnerAWSAccountId): void $this->queueOwnerAWSAccountId = $queueOwnerAWSAccountId; } - public function setRegion(string $region = null): void + public function setRegion(?string $region = null): void { $this->region = $region; } diff --git a/pkg/sqs/SqsMessage.php b/pkg/sqs/SqsMessage.php index cd2b1bdfe..772c3e217 100644 --- a/pkg/sqs/SqsMessage.php +++ b/pkg/sqs/SqsMessage.php @@ -144,7 +144,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply_to', $replyTo); } @@ -154,7 +154,7 @@ public function getReplyTo(): ?string return $this->getHeader('reply_to'); } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', $correlationId); } @@ -164,7 +164,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', $messageId); } @@ -181,7 +181,7 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } @@ -211,7 +211,7 @@ public function getDelaySeconds(): int * any messages sent with the same MessageDeduplicationId are accepted successfully but aren't delivered during the 5-minute * deduplication interval. For more information, see http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing. */ - public function setMessageDeduplicationId(string $id = null): void + public function setMessageDeduplicationId(?string $id = null): void { $this->messageDeduplicationId = $id; } @@ -230,7 +230,7 @@ public function getMessageDeduplicationId(): ?string * for multiple users). In this scenario, multiple readers can process the queue, but the session data * of each user is processed in a FIFO fashion. */ - public function setMessageGroupId(string $id = null): void + public function setMessageGroupId(?string $id = null): void { $this->messageGroupId = $id; } @@ -247,7 +247,7 @@ public function getMessageGroupId(): ?string * If you receive a message more than once, each time you receive it, you get a different receipt handle. * You must provide the most recently received receipt handle when you request to delete the message (otherwise, the message might not be deleted). */ - public function setReceiptHandle(string $receipt = null): void + public function setReceiptHandle(?string $receipt = null): void { $this->receiptHandle = $receipt; } diff --git a/pkg/sqs/SqsProducer.php b/pkg/sqs/SqsProducer.php index 98c133acc..2e43d8370 100644 --- a/pkg/sqs/SqsProducer.php +++ b/pkg/sqs/SqsProducer.php @@ -81,7 +81,7 @@ public function send(Destination $destination, Message $message): void /** * @return SqsProducer */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { $this->deliveryDelay = $deliveryDelay; @@ -96,7 +96,7 @@ public function getDeliveryDelay(): ?int /** * @return SqsProducer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (null === $priority) { return $this; @@ -113,7 +113,7 @@ public function getPriority(): ?int /** * @return SqsProducer */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { if (null === $timeToLive) { return $this; diff --git a/pkg/stomp/StompDestination.php b/pkg/stomp/StompDestination.php index 30e858e1d..57432f917 100644 --- a/pkg/stomp/StompDestination.php +++ b/pkg/stomp/StompDestination.php @@ -122,7 +122,7 @@ public function getRoutingKey(): ?string return $this->routingKey; } - public function setRoutingKey(string $routingKey = null): void + public function setRoutingKey(?string $routingKey = null): void { $this->routingKey = $routingKey; } diff --git a/pkg/stomp/StompMessage.php b/pkg/stomp/StompMessage.php index bb563c8cd..7098679b7 100644 --- a/pkg/stomp/StompMessage.php +++ b/pkg/stomp/StompMessage.php @@ -120,7 +120,7 @@ public function setRedelivered(bool $redelivered): void $this->redelivered = $redelivered; } - public function setCorrelationId(string $correlationId = null): void + public function setCorrelationId(?string $correlationId = null): void { $this->setHeader('correlation_id', (string) $correlationId); } @@ -130,7 +130,7 @@ public function getCorrelationId(): ?string return $this->getHeader('correlation_id'); } - public function setMessageId(string $messageId = null): void + public function setMessageId(?string $messageId = null): void { $this->setHeader('message_id', (string) $messageId); } @@ -147,7 +147,7 @@ public function getTimestamp(): ?int return null === $value ? null : (int) $value; } - public function setTimestamp(int $timestamp = null): void + public function setTimestamp(?int $timestamp = null): void { $this->setHeader('timestamp', $timestamp); } @@ -157,12 +157,12 @@ public function getFrame(): ?Frame return $this->frame; } - public function setFrame(Frame $frame = null): void + public function setFrame(?Frame $frame = null): void { $this->frame = $frame; } - public function setReplyTo(string $replyTo = null): void + public function setReplyTo(?string $replyTo = null): void { $this->setHeader('reply-to', $replyTo); } diff --git a/pkg/stomp/StompProducer.php b/pkg/stomp/StompProducer.php index 8c1933ee4..909720973 100644 --- a/pkg/stomp/StompProducer.php +++ b/pkg/stomp/StompProducer.php @@ -45,7 +45,7 @@ public function send(Destination $destination, Message $message): void /** * @return $this|Producer */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (empty($deliveryDelay)) { return $this; @@ -64,7 +64,7 @@ public function getDeliveryDelay(): ?int * * @return $this|Producer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (empty($priority)) { return $this; @@ -81,7 +81,7 @@ public function getPriority(): ?int /** * @return $this|Producer */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { if (empty($timeToLive)) { return $this; diff --git a/pkg/wamp/WampProducer.php b/pkg/wamp/WampProducer.php index 3bffe21f0..999ce77d9 100644 --- a/pkg/wamp/WampProducer.php +++ b/pkg/wamp/WampProducer.php @@ -117,7 +117,7 @@ public function send(Destination $destination, Message $message): void * * @return WampProducer */ - public function setDeliveryDelay(int $deliveryDelay = null): Producer + public function setDeliveryDelay(?int $deliveryDelay = null): Producer { if (null === $deliveryDelay) { return $this; @@ -136,7 +136,7 @@ public function getDeliveryDelay(): ?int * * @return WampProducer */ - public function setPriority(int $priority = null): Producer + public function setPriority(?int $priority = null): Producer { if (null === $priority) { return $this; @@ -155,7 +155,7 @@ public function getPriority(): ?int * * @return WampProducer */ - public function setTimeToLive(int $timeToLive = null): Producer + public function setTimeToLive(?int $timeToLive = null): Producer { if (null === $timeToLive) { return $this;