Skip to content

Cannot assign offset 'attributes' to Brevo\Client\Model\UpdateContact. #28

Open
@johnkhansrc

Description

@johnkhansrc

When I update the attributes of a Brevo contact as described in the documentation (https://developers.brevo.com/reference/updatecontact) PHPStan reports the following violation :

Cannot assign offset 'attributes' to Brevo\Client\Model\UpdateContact.

try {
            $identifier = '[email protected]';
            $updateContact = new UpdateContact();
            $updateContact['attributes'] = ['EMAIL'=>'[email protected]', 'FIRSTNAME'=>'John Doe'];

            $this->contactEndpoint->updateContact($identifier, $updateContact);
        } catch (\Exception $e) {
            $this->brevoLogger->error('Error while updating contact on SendinBlue', ['exception' => $e]);
        }

What is the correct way to modify a contact's attributes?

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