Skip to content

Fix amqp stub #1775

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

Merged
merged 3 commits into from
Aug 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions amqp/amqp.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ public function getCACert() {}
/**
* Set path to the CA cert file in PEM format
*
* @param string $cacert
* @param string|null $cacert
*
* @return void
*/
Expand All @@ -952,7 +952,7 @@ public function getCert() {}
/**
* Set path to the client certificate in PEM format
*
* @param string $cert
* @param string|null $cert
*
* @return void
*/
Expand Down Expand Up @@ -1161,34 +1161,34 @@ public function __construct(AMQPChannel $channel) {}
*
* Bind an exchange to another exchange using the specified routing key.
*
* @param string $exchangeName Name of the exchange to bind.
* @param string $routingKey The routing key to use for binding.
* @param array $arguments Additional binding arguments.
* @param string $exchangeName Name of the exchange to bind.
* @param string|null $routingKey The routing key to use for binding.
* @param array $arguments Additional binding arguments.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return void
*/
public function bind($exchangeName, $routingKey = '', array $arguments = []) {}
public function bind($exchangeName, $routingKey = null, array $arguments = []) {}

/**
* Remove binding to another exchange.
*
* Remove a routing key binding on an another exchange from the given exchange.
*
* @param string $exchangeName Name of the exchange to bind.
* @param string $routingKey The routing key to use for binding.
* @param array $arguments Additional binding arguments.
* @param string $exchangeName Name of the exchange to bind.
* @param string|null $routingKey The routing key to use for binding.
* @param array $arguments Additional binding arguments.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return void
*/
public function unbind($exchangeName, $routingKey = '', array $arguments = []) {}
public function unbind($exchangeName, $routingKey = null, array $arguments = []) {}

/**
* Declare a new exchange on the broker.
Expand All @@ -1215,19 +1215,19 @@ public function declare(): void {}
/**
* Delete the exchange from the broker.
*
* @param string $exchangeName Optional name of exchange to delete.
* @param int $flags Optionally AMQP_IFUNUSED can be specified
* to indicate the exchange should not be
* deleted until no clients are connected to
* it.
* @param string|null $exchangeName Optional name of exchange to delete.
* @param int|null $flags Optionally AMQP_IFUNUSED can be specified
* to indicate the exchange should not be
* deleted until no clients are connected to
* it.
*
* @throws AMQPExchangeException On failure.
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return void
*/
public function delete($exchangeName = null, $flags = AMQP_NOPARAM) {}
public function delete($exchangeName = null, $flags = null) {}

/**
* Get the argument associated with the given key.
Expand Down Expand Up @@ -1310,8 +1310,8 @@ public function publish(
/**
* Set the value for the given key.
*
* @param string $argumentName Name of the argument to set.
* @param string|int $argumentValue Value of the argument to set.
* @param string $argumentName Name of the argument to set.
* @param bool|int|float|string|null $argumentValue Value of the argument to set.
*
* @return void
*/
Expand All @@ -1329,7 +1329,7 @@ public function removeArgument(string $argumentName): void {}
*
* @param array $arguments An array of key/value pairs of arguments.
*
* @return bool TRUE on success or FALSE on failure.
* @return void
*/
public function setArguments(array $arguments) {}

Expand All @@ -1348,7 +1348,7 @@ public function setFlags($flags) {}
/**
* Set the name of the exchange.
*
* @param string $exchangeName The name of the exchange to set as string.
* @param string|null $exchangeName The name of the exchange to set as string.
*
* @return void
*/
Expand All @@ -1360,7 +1360,7 @@ public function setName($exchangeName) {}
* Set the type of the exchange. This can be any of AMQP_EX_TYPE_DIRECT,
* AMQP_EX_TYPE_FANOUT, AMQP_EX_TYPE_HEADERS or AMQP_EX_TYPE_TOPIC.
*
* @param string $exchangeType The type of exchange as a string.
* @param string|null $exchangeType The type of exchange as a string.
*
* @return void
*/
Expand Down Expand Up @@ -1431,7 +1431,7 @@ public function ack($deliveryTag, $flags = null) {}
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool
* @return void
*/
public function bind($exchangeName, $routingKey = null, array $arguments = []) {}

Expand All @@ -1450,7 +1450,7 @@ public function bind($exchangeName, $routingKey = null, array $arguments = []) {
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool
* @return void
*/
public function cancel($consumer_tag = '') {}

Expand Down Expand Up @@ -1526,7 +1526,7 @@ public function declare(): int {}
*
* This includes its entire contents of unread or unacknowledged messages.
*
* @param int $flags Optionally AMQP_IFUNUSED can be specified
* @param int|null $flags Optionally AMQP_IFUNUSED can be specified
* to indicate the queue should not be
* deleted until no clients are connected to
* it.
Expand All @@ -1536,7 +1536,7 @@ public function declare(): int {}
*
* @return int The number of deleted messages.
*/
public function delete($flags = AMQP_NOPARAM) {}
public function delete($flags = null) {}

/**
* Retrieve the next message from the queue.
Expand All @@ -1549,11 +1549,11 @@ public function delete($flags = AMQP_NOPARAM) {}
* automatically be marked as acknowledged by the broker as soon as the
* frames are sent to the client.
*
* @param int $flags A bitmask of supported flags for the
* method call. Currently, the only the
* supported flag is AMQP_AUTOACK. If this
* value is not provided, it will use the
* value of ini-setting amqp.auto_ack.
* @param int|null $flags A bitmask of supported flags for the
* method call. Currently, the only the
* supported flag is AMQP_AUTOACK. If this
* value is not provided, it will use the
* value of ini-setting amqp.auto_ack.
*
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
Expand Down Expand Up @@ -1592,16 +1592,16 @@ public function getName(): ?string {}
* undefined.
*
* @param int $deliveryTag Delivery tag of last message to reject.
* @param int $flags AMQP_REQUEUE to requeue the message(s),
* @param int|null $flags AMQP_REQUEUE to requeue the message(s),
* AMQP_MULTIPLE to nack all previous
* unacked messages as well.
*
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool
* @return void
*/
public function nack($deliveryTag, $flags = AMQP_NOPARAM) {}
public function nack($deliveryTag, $flags = null) {}

/**
* Mark one message as explicitly not acknowledged.
Expand All @@ -1618,7 +1618,7 @@ public function nack($deliveryTag, $flags = AMQP_NOPARAM) {}
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool
* @return void
*/
public function reject($deliveryTag, $flags = null) {}

Expand Down Expand Up @@ -1707,7 +1707,7 @@ public function hasArgument(string $argumentName): bool {}
* AMQP_DURABLE, AMQP_PASSIVE,
* AMQP_EXCLUSIVE, AMQP_AUTODELETE.
*
* @return bool
* @return void
*/
public function setFlags($flags = null) {}

Expand All @@ -1716,7 +1716,7 @@ public function setFlags($flags = null) {}
*
* @param string $name The name of the queue.
*
* @return bool
* @return void
*/
public function setName($name) {}

Expand All @@ -1732,7 +1732,7 @@ public function setName($name) {}
* @throws AMQPChannelException If the channel is not open.
* @throws AMQPConnectionException If the connection to the broker was lost.
*
* @return bool
* @return void
*/
public function unbind($exchangeName, $routingKey = null, array $arguments = []) {}

Expand Down