Initial POC of Message Type provider system #46
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a POC where message types are moved into service provider/facade allowing for the expansion of the type system by implementing system.
This isn't complete but the tests are passing!
What's been done:
Message type specific Resource data methods have been moved into type classes. This removes type-specific code from the resource.
Most of the hardcoded references to type codes have been removed and replaced with a Facade getter.
Definitions for system and non-system types are now defined in the MessageType repository.
Relevant tests have been updated.
There are a number of bits and pieces for the document/audio/image types which haven't been moved over and might require a bit more thought as to how they are going to be handled. Things like
->isImage()
shouldn't be necessary, but should be handled better.There are a handful of
Message::*
for non-system messages that haven't been touched yet. I just don't want to flesh everything else out if this isn't a good direction.