Skip to content

Commit 0f0570d

Browse files
authored
Explicitly declare parameter types as nullable (#19)
Starting with PHP 8.4, implicit nullability triggers a deprecation warning. See https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
1 parent d40e7dd commit 0f0570d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Codeception/Module/AMQP.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function _before(TestInterface $test): void
116116
* $I->pushToExchange('exchange.emails', new AMQPMessage('Thanks!'), 'severity');
117117
* ```
118118
*/
119-
public function pushToExchange(string $exchange, string|AMQPMessage $message, string $routing_key = null): void
119+
public function pushToExchange(string $exchange, string|AMQPMessage $message, ?string $routing_key = null): void
120120
{
121121
$message = $message instanceof AMQPMessage
122122
? $message
@@ -166,8 +166,8 @@ public function declareExchange(
166166
bool $auto_delete = true,
167167
bool $internal = false,
168168
bool $nowait = false,
169-
array $arguments = null,
170-
int $ticket = null
169+
?array $arguments = null,
170+
?int $ticket = null
171171
) {
172172
return $this->getChannel()->exchange_declare(
173173
$exchange,
@@ -203,8 +203,8 @@ public function declareQueue(
203203
bool $exclusive = false,
204204
bool $auto_delete = true,
205205
bool $nowait = false,
206-
array $arguments = null,
207-
int $ticket = null
206+
?array $arguments = null,
207+
?int $ticket = null
208208
): ?array {
209209
return $this->getChannel()->queue_declare(
210210
$queue,
@@ -239,8 +239,8 @@ public function bindQueueToExchange(
239239
string $exchange,
240240
string $routing_key = '',
241241
bool $nowait = false,
242-
array $arguments = null,
243-
int $ticket = null
242+
?array $arguments = null,
243+
?int $ticket = null
244244
) {
245245
return $this->getChannel()->queue_bind(
246246
$queue,

0 commit comments

Comments
 (0)