Document/Builder/DocumentBuilder.php
protected function buildAddressData(Common\AddressInterface $address, string $locale)
    {
        // TODO localize
        $country = Intl::getRegionBundle()->getCountryName($address->getCountry()->getCode(), $locale);

        $fullName = trim($address->getFirstName() . ' ' . $address->getLastName());

        // TODO if empty full customer name

        $data = [
            'company'     => $address->getCompany(),
            'full_name'   => $fullName,
            'street'      => $address->getStreet(),
            'complement'  => $address->getComplement(),
            'supplement'  => $address->getSupplement(),
            'postal_code' => $address->getPostalCode(),
            'city'        => $address->getCity(),
            'country'     => $country,
            'state'       => '',
            'phone'       => $this->formatPhoneNumber($address->getPhone()),
            'mobile'      => $this->formatPhoneNumber($address->getMobile()),
        ];

        if ($address instanceof RelayPointInterface) {
            $data['number'] = $address->getNumber();
        }

        return $data;
    }
protected function buildAddressData(Common\AddressInterface $address, string $locale)
    {
        // TODO localize
        $country = Intl::getRegionBundle()->getCountryName($address->getCountry()->getCode(), $locale);

        $fullName = trim($address->getFirstName() . ' ' . $address->getLastName());

        // TODO if empty full customer name

        $data = [
            'company'     => $address->getCompany(),
            'full_name'   => $fullName,
            'street'      => $address->getStreet(),
            'complement'  => $address->getComplement(),
            'supplement'  => $address->getSupplement(),
            'postal_code' => $address->getPostalCode(),
            'city'        => $address->getCity(),
            'country'     => $country,
            'state'       => '',
            'phone'       => $this->formatPhoneNumber($address->getPhone()),
            'mobile'      => $this->formatPhoneNumber($address->getMobile()),
        ];

        if ($address instanceof RelayPointInterface) {
            $data['number'] = $address->getNumber();
        }

        return $data;
    }
Builds the document's address data.

@param Common\AddressInterface $address
@param string                  $locale

@return array