Skip to content

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

@TheUnableDeveloper

Description

@TheUnableDeveloper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions