Codeception / Codeception/module-amqp

`?array $arguments = null,` should be `array|AMQPTable|null $arguments = null,`

Aperta
#23 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PHP
Stelle
4
Fork
9
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Found in declare* Methods.

When using codeception amqp with the bunny implementation array results in an runtime error (because bunny also has a bug) and passing AMQPTable (which works after patching it) results in an PHP Type Error.

Here is the patch I used which works:
```patch
Index: src/Codeception/Module/AMQP.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Codeception/Module/AMQP.php b/src/Codeception/Module/AMQP.php
--- a/src/Codeception/Module/AMQP.php
+++ b/src/Codeception/Module/AMQP.php (date 1759839586848)
@@ -13,6 +13,7 @@
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Exception\AMQPProtocolChannelException;
use PhpAmqpLib\Message\AMQPMessage;
+use PhpAmqpLib\Wire\AMQPTable;

/**
* This module interacts with message broker software that implements
@@ -166,7 +167,7 @@
bool $auto_delete = true,
bool $internal = false,
bool $nowait = false,
- ?array $arguments = null,
+ array|AMQPTable|null $arguments = null,
?int $ticket = null
) {
return $this->getChannel()->exchange_declare(
@@ -203,7 +204,7 @@
bool $exclusive = false,
bool $auto_delete = true,
bool $nowait = false,
- ?array $arguments = null,
+ array|AMQPTable|null $arguments = null,
?int $ticket = null
): ?array {
return $this->getChannel()->queue_declare(
@@ -239,7 +240,7 @@
string $exchange,
string $routing_key = '',
bool $nowait = false,
- ?array $arguments = null,
+ array|AMQPTable|null $arguments = null,
?int $ticket = null
) {
return $this->getChannel()->queue_bind(

```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia in src/Codeception/Module/AMQP.php e ispeziona le firme dei metodi exchange_declare, queue_declare e queue_bind. Confronta la gestione dei relativi argomenti con la patch fornita, inclusa l’importazione di AMQPTable. Il lavoro è completato quando questi metodi accettano array, AMQPTable o null senza l’errore di tipo PHP segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php
Ambito
backend, distributed-systems
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.