protected function buildView(AddressInterface $address, AddressFormat $addressFormat, array $options)
    {
        $countries = $this->countryRepository->getList($options['locale']);
        $values = $this->getValues($address, $addressFormat);
        $countryCode = $address->getCountryCode();

        $view = [];
        $view['country'] = [
            'html' => $options['html'],
            'html_tag' => 'span',
            'html_attributes' => ['class' => 'country'],
            'value' => isset($countries[$countryCode]) ? $countries[$countryCode] : $countryCode,
        ];
        foreach ($addressFormat->getUsedFields() as $field) {
            // The constant is more suitable as a class than the value since
            // it's snake_case and not camelCase.
            $class = str_replace('_', '-', strtolower(AddressField::getKey($field)));
            $view[$field] = [
                'html' => $options['html'],
                'html_tag' => 'span',
                'html_attributes' => ['class' => $class],
                'value' => $values[$field],
            ];
        }

        return $view;
    }
protected function buildView(AddressInterface $address, AddressFormat $addressFormat, array $options)
    {
        $countries = $this->countryRepository->getList($options['locale']);
        $values = $this->getValues($address, $addressFormat);
        $countryCode = $address->getCountryCode();

        $view = [];
        $view['country'] = [
            'html' => $options['html'],
            'html_tag' => 'span',
            'html_attributes' => ['class' => 'country'],
            'value' => isset($countries[$countryCode]) ? $countries[$countryCode] : $countryCode,
        ];
        foreach ($addressFormat->getUsedFields() as $field) {
            // The constant is more suitable as a class than the value since
            // it's snake_case and not camelCase.
            $class = str_replace('_', '-', strtolower(AddressField::getKey($field)));
            $view[$field] = [
                'html' => $options['html'],
                'html_tag' => 'span',
                'html_attributes' => ['class' => $class],
                'value' => $values[$field],
            ];
        }

        return $view;
    }
protected function buildView ( AddressInterface $ address , AddressFormat $ addressFormat , array $ options ) { $ countries = $ this -> countryRepository -> getList ( $ options [ 'locale' ] ) ; $ values = $ this -> getValues ( $ address , $ addressFormat ) ; $ countryCode = $ address -> getCountryCode ( ) ; $ view = [ ] ; $ view [ 'country' ] = [ 'html' => $ options [ 'html' ] , 'html_tag' => 'span' , 'html_attributes' => [ 'class' => 'country' ] , 'value' => isset ( $ countries [ $ countryCode ] ) ? $ countries [ $ countryCode ] : $ countryCode , ] ; foreach ( $ addressFormat -> getUsedFields ( ) as $ field ) { // The constant is more suitable as a class than the value since // it's snake_case and not camelCase. $ class = str_replace ( '_' , '-' , strtolower ( AddressField :: getKey ( $ field ) ) ) ; $ view [ $ field ] = [ 'html' => $ options [ 'html' ] , 'html_tag' => 'span' , 'html_attributes' => [ 'class' => $ class ] , 'value' => $ values [ $ field ] , ] ; } return $ view ; }
Builds the view for the given address.

@param AddressInterface $address       The address.
@param AddressFormat    $addressFormat The address format.
@param array            $options       The formatting options.

@return array The view.
Builds the view for the given address .