src/Client.php
private function parseAddresses($addresses)
    {
        if (!$addresses) {
            return array();
        }
        if (is_string($addresses)) {
            // old format json string, parse to array
            if ('[' != $addresses[0]) {
                // Expecting a json array, assuming single address
                $address = new Address();
                //todo: parse in id, uuid and type if set
                $address->setIdentifier($addresses);
                $address->setName('');
                $address->setType('email');

                return array($address);
            }
            $addresses = json_decode($addresses, true);
        }

        $res = array();
        foreach ($addresses as $a) {
            $address = new Address();
            //todo: parse in id, uuid and type if set
            $address->setIdentifier($a['identifier']);
            $address->setName($a['name']);
            $address->setType('email');
            $res[] = $address;
        }

        return $res;
    }
private function parseAddresses($addresses)
    {
        if (!$addresses) {
            return array();
        }
        if (is_string($addresses)) {
            // old format json string, parse to array
            if ('[' != $addresses[0]) {
                // Expecting a json array, assuming single address
                $address = new Address();
                //todo: parse in id, uuid and type if set
                $address->setIdentifier($addresses);
                $address->setName('');
                $address->setType('email');

                return array($address);
            }
            $addresses = json_decode($addresses, true);
        }

        $res = array();
        foreach ($addresses as $a) {
            $address = new Address();
            //todo: parse in id, uuid and type if set
            $address->setIdentifier($a['identifier']);
            $address->setName($a['name']);
            $address->setType('email');
            $res[] = $address;
        }

        return $res;
    }
/*
Current server returns a JSON string, not actual array data
This method detects strings and decodes them
Then it instantiates a new Address object for every item and returns
an array of Address objects