Change the '$$' identifier to a constant#1
Merged
sebastiaanluca merged 3 commits intosebastiaanluca:developfrom Feb 26, 2018
Merged
Change the '$$' identifier to a constant#1sebastiaanluca merged 3 commits intosebastiaanluca:developfrom
sebastiaanluca merged 3 commits intosebastiaanluca:developfrom
Conversation
The '$$' identifier has a few problems, and replacing it with a constant is an attempt to alleviate those: - '$$' is not a language construct like the RFC proposes, so people looking into the code will not be familiar with it and what it represents - When processing user input, '$$' could be a perfectly valid string and is now something that the developer must explicitly check for The proposed constant is named appropriately so that any developer reading it in use can tell what it represents, and it uses an ID generated by uniqid() so as to not conflict with user input.
Owner
|
Finally got some time to review this. Good points and excellent fix, thank you for this! I'll tag a v2 release in a moment. |
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.
PR Type
What does it change?
Proposes a constant that is named appropriately so that any developer reading it in use can tell what it represents, and it uses an ID generated by uniqid() so as to not conflict with user input.
Why this PR?
The '$$' identifier has a few problems, and replacing it with a constant is an attempt to alleviate those:
How has this been tested?
Existing tests have been modified to account for this change.