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

Tighten MessageType and ActorType usage #11696

Closed

Conversation

provokateurin
Copy link
Member

☑️ Resolves

I added the missing message types and tightened the types of the message type and actor type methods to ensure only valid values will be passed. It's not possible to do this with virtual methods (@psalm-method exists but doesn't seem to work).

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • 📘 API documentation in docs/ has been updated or is not required
  • 🔖 Capability is added or not needed

Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
@provokateurin provokateurin force-pushed the refactor/tighten-messagetype-actortype-method-types branch from 6bfd66a to 616b3a1 Compare March 1, 2024 12:02
@provokateurin
Copy link
Member Author

Looks like the default values need to be kept, but that violates the enums and we know that the values will always be set.

@nickvergessen
Copy link
Member

we know that the values will always be set.

Only later on. when you do new X() and call getActorType() on it, it returns the default value...

@provokateurin
Copy link
Member Author

This can sadly not be fixed in a proper way because of the empty string as a default value. If it was null then it wouldn't be a problem, but string enums with an empty string as default are bad.

@provokateurin provokateurin deleted the refactor/tighten-messagetype-actortype-method-types branch March 3, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants