@@ -97,7 +97,7 @@ class Connection
97
97
private \AMQPExchange $ amqpDelayExchange ;
98
98
private int $ lastActivityTime = 0 ;
99
99
100
- public function __construct (#[\SensitiveParameter] array $ connectionOptions , array $ exchangeOptions , array $ queuesOptions , AmqpFactory $ amqpFactory = null )
100
+ public function __construct (#[\SensitiveParameter] array $ connectionOptions , array $ exchangeOptions , array $ queuesOptions , ? AmqpFactory $ amqpFactory = null )
101
101
{
102
102
if (!\extension_loaded ('amqp ' )) {
103
103
throw new LogicException (sprintf ('You cannot use the "%s" as the "amqp" extension is not installed. ' , __CLASS__ ));
@@ -161,7 +161,7 @@ public function __construct(#[\SensitiveParameter] array $connectionOptions, arr
161
161
* * verify: Enable or disable peer verification. If peer verification is enabled then the common name in the
162
162
* server certificate must match the server name. Peer verification is enabled by default.
163
163
*/
164
- public static function fromDsn (#[\SensitiveParameter] string $ dsn , array $ options = [], AmqpFactory $ amqpFactory = null ): self
164
+ public static function fromDsn (#[\SensitiveParameter] string $ dsn , array $ options = [], ? AmqpFactory $ amqpFactory = null ): self
165
165
{
166
166
if (false === $ params = parse_url ($ dsn )) {
167
167
// this is a valid URI that parse_url cannot handle when you want to pass all parameters as options
@@ -279,7 +279,7 @@ private static function hasCaCertConfigured(array $amqpOptions): bool
279
279
/**
280
280
* @throws \AMQPException
281
281
*/
282
- public function publish (string $ body , array $ headers = [], int $ delayInMs = 0 , AmqpStamp $ amqpStamp = null ): void
282
+ public function publish (string $ body , array $ headers = [], int $ delayInMs = 0 , ? AmqpStamp $ amqpStamp = null ): void
283
283
{
284
284
$ this ->clearWhenDisconnected ();
285
285
@@ -313,7 +313,7 @@ public function countMessagesInQueues(): int
313
313
/**
314
314
* @throws \AMQPException
315
315
*/
316
- private function publishWithDelay (string $ body , array $ headers , int $ delay , AmqpStamp $ amqpStamp = null ): void
316
+ private function publishWithDelay (string $ body , array $ headers , int $ delay , ? AmqpStamp $ amqpStamp = null ): void
317
317
{
318
318
$ routingKey = $ this ->getRoutingKeyForMessage ($ amqpStamp );
319
319
$ isRetryAttempt = $ amqpStamp ? $ amqpStamp ->isRetryAttempt () : false ;
@@ -329,7 +329,7 @@ private function publishWithDelay(string $body, array $headers, int $delay, Amqp
329
329
);
330
330
}
331
331
332
- private function publishOnExchange (\AMQPExchange $ exchange , string $ body , string $ routingKey = null , array $ headers = [], AmqpStamp $ amqpStamp = null ): void
332
+ private function publishOnExchange (\AMQPExchange $ exchange , string $ body , ? string $ routingKey = null , array $ headers = [], ? AmqpStamp $ amqpStamp = null ): void
333
333
{
334
334
$ attributes = $ amqpStamp ? $ amqpStamp ->getAttributes () : [];
335
335
$ attributes ['headers ' ] = array_merge ($ attributes ['headers ' ] ?? [], $ headers );
0 commit comments