Filtered list of addresses => name pairs.

@return array
432996
private function filterNameAddresses(array $recipients)
    {
        $filtered = [];

        foreach ($recipients as $address => $name) {
            if ($this->isWhitelisted($address)) {
                $filtered[$address] = $name;
            }
        }

        return $filtered;
    }
70676
public function getAllEmailAddresses() {
        $saveCurrentFolder = $this->folder;
        $emails = array();
        foreach($this->getFolders() as $folder) {
            $this->selectFolder($folder);
            foreach($this->getMessages(false) as $message) {
                $emails[] = $message['from'];
                $emails = array_merge($emails, $message['to']);
                if (isset($message['cc'])) {
                    $emails = array_merge($emails, $message['cc']);
                }
            }
        }
        $this->selectFolder($saveCurrentFolder);
        return array_unique($emails);
    }
365791
public function getFields()
    {
        $model = $this->getModelInstance();
        $fields = $model->getFillable();
        $filtered_fields = [];

        foreach ($fields as $f) {
            if ($f !== 'password' && $f !== 'Password') {
                $filtered_fields[] = $f;
            }
        }

        return $filtered_fields;
    }
342221
private function getAllEmailAddresses($parts, $fields = ['to', 'from', 'cc', 'bcc'])
    {
        $addresses = [];
        foreach ($fields as $field) {
            $addressesPerField = [];
            foreach ($parts as $part) {
                 $addressesPerField = array_merge(
                     $addressesPerField,
                     $this->getAddressesFromFieldInPart($field, $part)
                 );
            }
            $addresses[$field] = $addressesPerField;
        }

        return $addresses;
    }
182705
protected function filterContainsZip($filter)
    {
        $return = [];

        if (
            (isset($filter->string) && preg_match('/^\d{5}(?:[-\s]\d{4})?$/', $filter->string))
            || false !== strpos(serialize($filter), 'zipcode')
        ) {
            $return = ['l.zipcode'];
        }

        return $return;
    }
338985
protected function GetUserAddressData()
    {
        $aUserAddressData = array();
        $oActiveUser = TdbDataExtranetUser::GetInstance();
        if ($oActiveUser) {
            $oBillingAddress = $oActiveUser->GetBillingAddress();
            if ($oBillingAddress) {
                $aUserAddressData['addr_street'] = $oBillingAddress->fieldStreet.' '.$oBillingAddress->fieldStreetnr;
                $aUserAddressData['addr_zip'] = $oBillingAddress->fieldPostalcode;
                $aUserAddressData['addr_city'] = $oBillingAddress->fieldCity;
                $aUserAddressData['addr_country'] = $this->GetBillingCountryISOCode($oBillingAddress);
                $aUserAddressData['addr_email'] = $oActiveUser->fieldName;
            }
        }

        return $aUserAddressData;
    }
1123953
public static function getNameList()
    {
        $result = [];
        $pages = self::sortBy('baseFileName')->all();
        foreach ($pages as $page) {
            $result[$page->baseFileName] = $page->title . ' (' . $page->baseFileName . ')';
        }

        return $result;
    }
97330
protected function parseAddress(array $addresses)
    {
        return array_map(function ($address) {
            return (object) [
                'address' => $address->mailbox.'@'.$address->host,
                'domain' => $address->host,
                'name' => isset($address->personal)
                    ? static::convertBodyEncoding($address->personal)
                    : null
            ];
        }, array_filter($addresses, function ($address) {
            return property_exists($address, 'mailbox') && strtolower($address->mailbox) !== 'undisclosed-recipients';
        }));
    }
229858
public function getAddresses($name)
    {
        $value = $this->getRawHeader($name);
        $value = (is_array($value)) ? $value[0] : $value;
        $addresses = mailparse_rfc822_parse_addresses($value);
        foreach ($addresses as $i => $item) {
            $addresses[$i]['display'] = $this->decodeHeader($item['display']);
        }
        return $addresses;
    }
450090
def getaddresses (addr):
    """"""
    parsed = [mail for name, mail in AddressList(addr).addresslist if mail]
    if parsed:
        addresses = parsed
    elif addr:
        # we could not parse any mail addresses, so try with the raw string
        addresses = [addr]
    else:
        addresses = []
    return addresses
558734
public function toArray()
    {
        return array(
            static::FIELD_NAME                    => $this->_name,
            static::FIELD_STREET_ADDRESS          => $this->_streetAddress,
            static::FIELD_STREET_ADDRESS_ADDITION => $this->_streetAddressAddition,
            static::FIELD_CITY                    => $this->_city,
            static::FIELD_POSTAL_CODE             => $this->_postalCode,
            static::FIELD_COUNTRY                 => $this->_country,
            static::FIELD_STATE                   => $this->_state,
            static::FIELD_PHONE                   => $this->_phone,
        );
    }
1042516
public function getAssociationNames()
    {
        $names = array();

        foreach ($this->getAssociations() as $field) {
            $names[] = $field->name;
        }

        return $names;
    }
695312
protected function getSurnamesList() {        
        return QueryName::surnames(Globals::getTree(), $this->surname, $this->alpha, false, false);
    }
1041018
public function getParamNames(): array
    {
        $names = [];

        foreach ($this->getPublicProperties() as $param) {
            $names[] = $param->getName();
        }

        return $names;
    }
392093
public function getInputsAddresses()
    {
        $addresses = array();
        foreach ($this->getTx()->getInputs() as $txInput) {
            $inputAddresses = $txInput->getAddresses();
            if (is_array($inputAddresses)) {
                $addresses = array_merge($addresses, $inputAddresses);
            }
        }
        return $addresses;
    }
702236
public function getSelectedAddress()
    {
        if ($this->_oSelAddress !== null) {
            return $this->_oSelAddress;
        }

        $oSelectedAddress = null;
        $oAddresses = $this->getUserAddresses();
        if ($oAddresses->count()) {
            if ($sAddressId = $this->getSelectedAddressId()) {
                foreach ($oAddresses as $oAddress) {
                    if ($oAddress->getId() == $sAddressId) {
                        $oAddress->selected = 1;
                        $oAddress->setSelected();
                        $oSelectedAddress = $oAddress;
                        break;
                    }
                }
            }

            // in case none is set - setting first one
            if (!$oSelectedAddress) {
                if (!$sAddressId || $sAddressId >= 0) {
                    $oAddresses->rewind();
                    $oAddress = $oAddresses->current();
                } else {
                    $aAddresses = $oAddresses->getArray();
                    $oAddress = array_pop($aAddresses);
                }
                $oAddress->selected = 1;
                $oAddress->setSelected();
                $oSelectedAddress = $oAddress;
            }
        }
        $this->_oSelAddress = $oSelectedAddress;

        return $oSelectedAddress;
    }
566329
public function getAllowedAddressCountries()
    {
        $allowedShippingCountries    = $this->getAllowedShippingCountries();
        $allowedShippingCountriesMap = array_map(
            function ($country) {
                return $country['country'];
            },
            $allowedShippingCountries
        );

        $allowedAddressCountries = [];
        foreach ($this->mainShipHelper->getMageShippingCountries() as $addressCountry) {
            $state  = array_search($addressCountry, $allowedShippingCountriesMap, true);
            $states = $state !== false ? $allowedShippingCountries[$state]['state'] : ['All'];

            $allowedAddressCountries[] =
                [
                    'country' => $addressCountry,
                    'state'   => $states
                ];
        }

        return $allowedAddressCountries;
    }