Get list of user attributes as array

@return array list of converted attributes
343565
public function normalize(
        UserAttribute $userAttribute,
        UserAttributeValue $userAttributeValue = null
    ) {
        // original value
        if ($userAttributeValue) {
            $originalAttributeValue = $userAttributeValue->getValue();
        } else {
            $originalAttributeValue = null;
        }

        // prepare value
        $value = [];

        // value for view
        $value['view'] = $originalAttributeValue;
        if ($originalAttributeValue) {

            // translate value
            if ($userAttribute->isTranslateable()) {
                $value['view'] = $this->translator->trans($value['view']);
            }

            // format value
            $printFormat = $userAttribute->getPrintFormat();
            if ($printFormat) {
                $value['view'] = $this->renderValue(
                    $printFormat,
                    [
                        'value' => $value['view'],
                    ]
                );
            }
        }

        // value for edit
        $value['edit'] = $originalAttributeValue;

        // common attribute keys
        $normalizedAttributes = [
            'name' => $userAttribute->getName(),
            'label' => $this->translator->trans($userAttribute->getName()),
            'description' => $this->translator->trans($userAttribute->getDescription()),
            'type' => $userAttribute->getType(),
            'value' => $value,
        ];

        return $normalizedAttributes;
    }
666090
function attributes()
    {
        $attributes = array();
        $item = $this->InternalAttributes['item'];
        if ( is_array( $item ) )
        {
            $attributes = array_keys( $item );
        }
        else if ( is_object( $item ) and
                  method_exists( $item, 'attributes' ) )
        {
            $attributes = $item->attributes();
        }
        $attributes = array_merge( $this->InternalAttributes, $attributes );
        $attributes = array_unique( $attributes );
        return $attributes;
    }
1078957
public function toArray()
    {
        return [
            'text' => $this->getText($this->getModel()),
            'attributes' => $this->getConditionAttributes($this->model)->htmlAttributesToString(),
            'url' => $this->getUrl($this->getModel()),
            'position' => $this->getPosition(),
            'icon' => $this->getIcon(),
            'hideText' => $this->hideText,
        ];
    }
906888
public function attributes(): array
    {
        $languages = TransHelper::getAllLanguages();
        $translatedAttributes = ['name', 'slug'];

        $placeholder = 'for language ":lang"';

        if ($languages->count() == 1) {
            $language = $languages->first();

            return [
                "translations.{$language->iso_code}.name" => '',
                "translations.{$language->iso_code}.slug" => '',
            ];
        }

        $attributes = [];

        foreach ($translatedAttributes as $translatedAttribute) {
            foreach ($languages as $language) {
                $replaced = str_replace(':lang', $language->title_localized, $placeholder);
                $attributes["translations.{$language->iso_code}.{$translatedAttribute}"] = $replaced;
            }
        }

        return $attributes;
    }
374274
public function attributesToArray()
    {
        $attributes = parent::attributesToArray();

        foreach ($attributes as $key => $value) {
            if ($this->valid($key, $value)) {
                $attributes[$key] = decrypt($value);
            }
        }

        return $attributes;
    }
900729
public function getAttributes(): array
    {
        $attributes = $this->tag->getAttributes();
        foreach ($attributes as $name => $info) {
            $attributes[$name] = $info['value'];
        }

        return $attributes;
    }
998864
function get_attributes() {
        $configarray = (array) $this->config;

        $moodleattributes = array();
        $userfields = array_merge($this->userfields, $this->get_custom_user_profile_fields());
        foreach ($userfields as $field) {
            if (isset($configarray["field_map_$field"])) {
                $moodleattributes[$field] = $configarray["field_map_$field"];
            }
        }
        $moodleattributes['username'] = $configarray["user_attribute"];

        return $moodleattributes;
    }
1229578
protected function initUserAttributes()
    {
        $attributes = $this->api('me', 'GET', [
            'fields' => implode(',', [
                'id',
                'email',
                'first_name',
                'last_name',
                'picture.height(200).width(200)',
                'gender'
            ]),
        ]);

        $return_attributes = [
            'User' => [
                $this->email        => $attributes['email'],
                $this->first_name   => $attributes['first_name'],
                $this->last_name    => $attributes['last_name'],
                $this->avatar       => $attributes['picture']['data']['url'],
                $this->gender       => $this->normalizeSex()[$attributes['gender']],
                $this->status       => $this->statusActive,
            ],
            'provider_user_id' => $attributes['id'],
            'provider_id' => UserOauthKey::getAvailableClients()['facebook'],
            'page' => $attributes['id'],
        ];

        return $return_attributes;
    }
200083
protected function getAttributes()
    {
        $components = [];
        foreach ($this->arrayable as $attribute) {
            $components[] = $this->$attribute;
        }

        return $components;
    }
398831
public function toArray()
    {
        return array_map(function($value) {
            return $value instanceof ArrayInterface ? $value->toArray() : $value;
        }, $this->attributes);
    }
970231
public function __toArray()
    {
        $datas = [
            'id'   => (string)$this->id,
            'type' => (string)$this->type
        ];
        if ($this->attributes !== null) {
            $datas['attributes'] = $this->attributes->__toArray();
        }
        return $datas;
    }
1199173
public function getAttributes()
    {
        $attributes = (array) $this->serializer->getAttributes($this->data, $this->getOwnFields());

        $attributes = $this->filterFields($attributes);

        $attributes = $this->mergeAttributes($attributes);

        return $attributes;
    }
1056279
public function toArray()
    {

        $attributes = [];

        foreach ($this->attributes as $name => $value) {
            $attributes[$name] = $this->getOriginalAttribute($name);
        }

        foreach ($this->appends as $name) {
            $attributes[$name] = $this->getAppendsAttribute($name);
        }

        return $attributes;
    }
1144395
public function getAttributes(): array
    {
        $attributes = [];
        $attributes['message_id'] = $this->messageId;
        if ($this->blockId) {
            $attributes['block'] = $this->blockId;
        }
        return $attributes;
    }
1292261
public function attributes()
    {
        $attributes = \yii\base\Model::attributes();
        foreach (self::rules() as $rule) {
            if (is_string(reset($rule))) {
                continue;
            }
            foreach (reset($rule) as $attribute) {
                if (substr_compare($attribute, '!', 0, 1) === 0) {
                    $attribute = mb_substr($attribute, 1);
                }
                $attributes[$attribute] = $attribute;
            }
        }

        return array_values($attributes);
    }
496956
public function getAttributes(): array
    {
        $attributes = [];
        foreach ($this->wires as $address => $amount) {
            $attributes['wires'][$address] = AdsConverter::clicksToAds($amount);
        }

        return $attributes;
    }
546104
public function getAttributes()
    {
        $data = @ldap_get_attributes($this->connection, $this->entry);

        $result = array();

        for ($i = 0; $i < $data['count']; $i++) {
            $key = $data[$i];
            $result[$key] = array();
            for ($j = 0; $j < $data[$key]['count']; $j++) {
                $result[$key][] = $data[$key][$j];
            }
        }

        return $result;
    }