Skip to content

Cannot assign null to property Intercom\Types\PartAttachment::$width of type int #390

@KDederichs

Description

@KDederichs

After updating to the new SDK I got an error when trying to fetch a conversation with attachment:

/vendor/intercom/intercom-php/src/Types/PartAttachment.php in Intercom\Types\PartAttachment::__construct at line 74


69
        $this->type = $values['type'];
70
        $this->name = $values['name'];
71
        $this->url = $values['url'];
72
        $this->contentType = $values['contentType'];
73
        $this->filesize = $values['filesize'];
74
        $this->width = $values['width'];
75
        $this->height = $values['height'];
76
    }
77
78
    /**
79
     * @return string
/vendor/intercom/intercom-php/src/Core/Json/JsonSerializableType.php in Intercom\Core\Json\JsonSerializableType::jsonDeserialize at line 182


/vendor/intercom/intercom-php/src/Core/Json/JsonDeserializer.php in Intercom\Core\Json\JsonDeserializer::deserializeObject at line 166


/vendor/intercom/intercom-php/src/Core/Json/JsonDeserializer.php in Intercom\Core\Json\JsonDeserializer::deserializeSingleValue at line 135


/vendor/intercom/intercom-php/src/Core/Json/JsonDeserializer.php in Intercom\Core\Json\JsonDeserializer::deserializeValue at line 82


/vendor/intercom/intercom-php/src/Core/Json/JsonDeserializer.php in Intercom\Core\Json\JsonDeserializer::{closure:Intercom\Core\Json\JsonDeserializer::deserializeList():202} at line 202


[internal] in array_map
/vendor/intercom/intercom-php/src/Core/Json/JsonDeserializer.php in Intercom\Core\Json\JsonDeserializer::deserializeList at line 202


/vendor/intercom/intercom-php/src/Core/Json/JsonDeserializer.php in Intercom\Core\Json\JsonDeserializer::deserializeArray at line 57


/vendor/intercom/intercom-php/src/Core/Json/JsonSerializableType.php in Intercom\Core\Json\JsonSerializableType::jsonDeserialize at line 155


/vendor/intercom/intercom-php/src/Core/Json/JsonDeserializer.php in Intercom\Core\Json\JsonDeserializer::deserializeObject at line 166


/vendor/intercom/intercom-php/src/Core/Json/JsonSerializableType.php in Intercom\Core\Json\JsonSerializableType::jsonDeserialize at line 168


/vendor/intercom/intercom-php/src/Core/Json/JsonSerializableType.php in Intercom\Core\Json\JsonSerializableType::fromJson at line 104


/vendor/intercom/intercom-php/src/Conversations/ConversationsClient.php in Intercom\Conversations\ConversationsClient::find at line 215


/src/Service/Intercom.php in App\Service\Intercom::getConversation at line 134
In App


129
    }
130
131
    public function getConversation(string $conversationId): ?Conversation
132
    {
133
        try {
134
            return $this->client->conversations->find(new FindConversationRequest([
135
                'conversationId' => $conversationId
136
            ]));
137
        } catch (IntercomApiException|IntercomException) {
138
            return null;
139
        }
/src/MessageHandler/Intercom/IntercomFetchConversationAttachmentHandler.php in App\MessageHandler\Intercom\IntercomFetchConversationAttachmentHandler::__invoke at line 68

Wasn't an issue before so I assume that either needs to be nullable or the API always needs to return something that's not null

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