Skip to content
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

Too strict type checking for Message type #7

Closed
karptonite opened this issue Jul 9, 2024 · 2 comments
Closed

Too strict type checking for Message type #7

karptonite opened this issue Jul 9, 2024 · 2 comments

Comments

@karptonite
Copy link

In AkismetMessage, setType requires $type to be MessageType. However, Akismet allows you to send any string for a message type, as detailed here.

For this reason, setType() should accept any string. We are running into this issue as we transition to this library because we use a custom message type in some cases.

Thanks for your work on this!

@curry684
Copy link
Member

My apologies for the late response, missed this completely. We can fix this without B/C break by making the setters accept MessageType|string and converting it on the fly to store a string internally. We'd just need some magic in the getter to not break anything bad.

PR welcome or I'll pick it up later.

@curry684
Copy link
Member

Implemented with full B/C.

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

No branches or pull requests

2 participants