Skip to content

* 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

Merged
merged 1 commit into from
Apr 7, 2021
Merged

* LightSmsTransport.php - suggestion for pull request #40712 #40733

merged 1 commit into from
Apr 7, 2021

Conversation

StaffNowa
Copy link
Contributor

Q A
Branch? 5.x
Bug fix? no
New feature? no
Deprecations? no
Tickets Fix #40712
License MIT
Doc PR -

After remove issets still get warnings about undefined variables. My solution for this:

  1. Create method which have all issets cases.
  2. Return (int) errorCode

Copy link
Member

@jderusse jderusse left a 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[...] ?? ... ?? ...)

@StaffNowa
Copy link
Contributor Author

@jderusse You as always right 👍 Checked. Now works without any errors :)

@chalasr
Copy link
Member

chalasr commented Apr 7, 2021

@StaffNowa Can you please squash your commits? https://stackoverflow.com/a/5189600/4363634

@StaffNowa StaffNowa requested a review from sroze as a code owner April 7, 2021 21:47
@StaffNowa
Copy link
Contributor Author

omg something made bad... 💀

@StaffNowa
Copy link
Contributor Author

StaffNowa commented Apr 7, 2021

Finally

git rebase -f upstream/5.x
git push --force origin lighsms-suggestion

@chalasr
Copy link
Member

chalasr commented Apr 7, 2021

Well done :)

@chalasr
Copy link
Member

chalasr commented Apr 7, 2021

Good catch, thanks @StaffNowa.

@chalasr chalasr merged commit a6b589e into symfony:5.x Apr 7, 2021
Comment on lines +127 to +128
if (0 !== (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1) {
$errorCode = (int) ($content['error'] ?? $content['']['error'] ?? $content[$phone]['error']) ?? -1;
Copy link
Member

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) {

Copy link
Contributor Author

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 👍

Nyholm added a commit that referenced this pull request Apr 8, 2021
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy