Merged
Conversation
WendellAdriel
requested changes
Jun 13, 2023
Member
WendellAdriel
left a comment
There was a problem hiding this comment.
Besides the changes requested, you need to add the needed docs for the Union types
Member
|
@hungthai1401 thanks for the PR. Also, please beware that as we put in the Contributing Guide, before creating a whole new feature that's a big change like this one, an issue or a discussion should be used to discuss it first. We have a discussion open on this topic, before sending the PR you could have sent your idea there first. |
Member
Author
|
@WendellAdriel I got it. I have fixed your comments |
WendellAdriel
requested changes
Jun 13, 2023
WendellAdriel
requested changes
Jun 14, 2023
WendellAdriel
requested changes
Jun 15, 2023
Member
Author
|
@WendellAdriel I have fixed them |
WendellAdriel
requested changes
Jun 23, 2023
WendellAdriel
approved these changes
Jun 23, 2023
Member
WendellAdriel
left a comment
There was a problem hiding this comment.
Thanks for the help with this, @hungthai1401!!!
Member
Author
|
@WendellAdriel hope we can develop more features!!! |
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
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.
Hi @WendellAdriel ,
This PR introduces union types. I use flow chart to explain my implementation.
flowchart TD A[StrictusUnion] --> B{Validate Types} B -->|Yes| C{Validate Value} B -->|No| Z[StrictusTypeException] C -->|Yes| D{Detect Value Type} C -->|No| Z[StrictusTypeException] D -->|Int| E[StrictusInteger] D -->|String| G[StrictusString] D -->|Float| H[StrictusFloat] D -->|Boolean| I[StrictusBoolean] D -->|Array| K[StrictusArray] D -->|Object| L[StrictusObject] D -->|Class| M[StrictusInstance] D -->|Enum| N[StrictusEnum] D -->|No| Z[StrictusTypeException] A[StrictusUnion] --> F[Update Value] --> O{Immutable} O -->|Yes| Y[ImmutableStrictusException] O -->|No| CGreetings and thanks,
Thai