-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
* LightSmsTransport.php - suggestion for pull request #40712 #40733
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
Conversation
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.
no need for a new functions.
the issue is because missing parenthesis after casting.
It should have been (int) ($response[...] ?? ... ?? ...)
@jderusse You as always right 👍 Checked. Now works without any errors :) |
@StaffNowa Can you please squash your commits? https://stackoverflow.com/a/5189600/4363634 |
omg something made bad... 💀 |
Finally
|
Well done :) |
Good catch, thanks @StaffNowa. |
if (0 !== (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1) { | ||
$errorCode = (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1; |
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.
this is duplicated.
- if (0 !== (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1) {
- $errorCode = (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1;
+ $errorCode = (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1;
+ if (0 !== $code) {
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.
In line two see mistake in word $code, but found and fixed 👍
…StaffNowa) This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- [Notifier] LightSMS duplicated $errorCode variable fix | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #40712, #40733 | License | MIT | Doc PR | - Removed duplicated variable $errorCode. Many thanks for: @OskarStark, @jderusse and special thanks for @chalasr for fast rebase course at night :))) Commits ------- 867769e [Notifier] LightSMS duplicated $errorCode variable fix
After remove issets still get warnings about undefined variables. My solution for this: