Skip to content
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

Migration from gomoob/php-pushwoosh [possible regression] #19

Open
TheUnableDeveloper opened this issue Jan 14, 2025 · 1 comment
Open

Comments

@TheUnableDeveloper
Copy link

TheUnableDeveloper commented Jan 14, 2025

Hello,
I just migrated my project from gomoob/php-pushwoosh,
What I did was basically removing the old library from composer.json and then I added the new one.

Everything works Except something in this file:
src/main/php/Gomoob/Pushwoosh/Model/Notification/IOS.php

public function jsonSerialize(): mixed
    {
        $json = [];

        isset($this->apnsTrimContent) ? $json['apns_trim_content'] = intval($this->apnsTrimContent) : false;
        isset($this->badges) ? $json['ios_badges'] = $this->badges : false;
        isset($this->categoryId) ? $json['ios_category_id'] = $this->categoryId : false;
        isset($this->rootParams) ? $json['ios_root_params'] = $this->rootParams : false;
        isset($this->sound) ? $json['ios_sound'] = $this->sound : false;
        isset($this->ttl) ? $json['ios_ttl'] = $this->ttl : false;
        isset($this->trimContent) ? $json['ios_trim_content'] = intval($this->trimContent) : false;

        if ($this->threadId !== null) { // <--- EXCEPTION ----------
            $json['ios_thread_id'] = $this->threadId;
        }

        return $json;

    }

Exception:
"Typed property Gomoob\Pushwoosh\Model\Notification\IOS::$threadId must not be accessed before initialization", line 124

this is the contenct of my $json variable
image

two questions:

  1. Is it the proper way to migrate the one I described?
  2. Is this exception generated by the library OR by my code?

Thanks!

Versions:
PHP: 8.2.25
Library: 2.1.0

@TheUnableDeveloper
Copy link
Author

Small update:
I tried the library version 2.0.0 and everything works fine, so I guess it's a regression

@TheUnableDeveloper TheUnableDeveloper changed the title Migration from gomoob/php-pushwoosh Migration from gomoob/php-pushwoosh [possible regression] Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant