FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Optimized the `Hyperf\Amqp\Message\Message::getTypeString()` method to prevent conflicts between property and getter methods. by limingxinleo · Pull Request #7741 · hyperf/hyperf · GitHub

/ hyperf Public

Optimized the Hyperf\Amqp\Message\Message::getTypeString() method to prevent conflicts between property and getter methods. - #7741

Merged
limingxinleo merged 2 commits into
hyperf:masterfrom
limingxinleo:v3.1-fix-7634
Apr 20, 2026
Merged

Optimized the Hyperf\Amqp\Message\Message::getTypeString() method to prevent conflicts between property and getter methods.#7741
limingxinleo merged 2 commits into
hyperf:masterfrom
limingxinleo:v3.1-fix-7634

Conversation

Copy link
Copy Markdown
Member

fix #7634

limingxinleo requested a review from Copilot April 20, 2026 12:54
limingxinleo merged commit c9d2ddf into hyperf:master Apr 20, 2026
62 checks passed
limingxinleo deleted the v3.1-fix-7634 branch April 20, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

This PR addresses Hyperf issue #7634 by updating how AMQP message exchange types are converted to strings, ensuring delayed-exchange declarations respect overridden getType() implementations in subclasses.

Changes:

  • Updated Message::getTypeString() to derive the type via getType() instead of reading the $type property directly.
  • Added a changelog entry documenting the update in the 3.1 line.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/amqp/src/Message/Message.php Makes getTypeString() honor overridden getType() to avoid delayed-exchange type mismatches.
CHANGELOG-3.1.md Records the change for the upcoming 3.1.68 release notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG-3.1.md
Comment on lines 8 to +12

## Optimized

- [#7741](https://github.com/hyperf/hyperf/pull/7741) Optimized the `Hyperf\Amqp\Message\Message::getTypeString()` method to prevent conflicts between property and getter methods.

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This entry describes a bug fix for #7634 (incorrect delayed exchange type), so it likely belongs under the "## Fixed" section rather than "## Optimized" to keep release notes consistent with the rest of the changelog.

Suggested change
## Optimized
- [#7741](https://github.com/hyperf/hyperf/pull/7741) Optimized the `Hyperf\Amqp\Message\Message::getTypeString()` method to prevent conflicts between property and getter methods.
- [#7741](https://github.com/hyperf/hyperf/pull/7741) Fixed bug that the `Hyperf\Amqp\Message\Message::getTypeString()` method may conflict between property and getter methods.

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +42
$type = $this->getType();
return $type instanceof Type ? $type->value : $type;

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There are existing AMQP PHPUnit tests, but this behavior change (routing delayed exchange argument x-delayed-type now respecting overridden getType()) is not covered. Please add/adjust a test to assert that when a producer overrides getType() to return a different Type value, getTypeString() reflects it (and thus delayed exchange builder uses the expected string).

Copilot uses AI. Check for mistakes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AMqp延迟队列生成的类型与配置的类型不匹配,设置FANOUT却生成的是Topic

2 participants


Back | FazBrowse Home | New Git URL