-
Notifications
You must be signed in to change notification settings - Fork 3
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
Do not cast integer as string ids + Fix Zero ID + PHP Coduo #93
Conversation
@@ -50,11 +50,7 @@ protected function bindIdIfProvided(JsonRpcRequest $request, array $item) : void | |||
{ | |||
/** If no id defined => request is a notification */ | |||
if (isset($item[self::KEY_ID])) { | |||
$request->setId( | |||
$item[self::KEY_ID] == (string)((int)$item[self::KEY_ID]) | |||
? (int)$item[self::KEY_ID] // Convert it in case it's a string containing an int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure why I did that 🤔 Saw nothing on JSON-RPC specification regarding that point => removed
EDIT: Most likely a matter of typehint, but there is already a check on setId
method to ensure id is either a string or an interger
Codecov Report
@@ Coverage Diff @@
## master #93 +/- ##
===========================================
Coverage 100.00% 100.00%
+ Complexity 170 169 -1
===========================================
Files 28 28
Lines 454 450 -4
===========================================
- Hits 454 450 -4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
No description provided.