Codeception / Codeception/module-amqp

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

オープン
#23 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
PHP
スター
4
フォーク
9
PR マージ指標
30日以内にマージされた PR はありません

説明

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(

```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

src/Codeception/Module/AMQP.php から始めて、exchange_declare、queue_declare、queue_bind メソッドのシグネチャを確認してください。AMQPTable の import を含め、引数の処理を提供されたパッチと比較してください。これらのメソッドが報告された PHP の型エラーなしで array、AMQPTable、または null を受け入れれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
backend, distributed-systems
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
58/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。