src/Models/Dom/RichText.php
private static function asImageBlock(array $richText) {

        // Check if the value is a image object:
        foreach(['dimensions', 'alt','url'] as $key) {
            if(!key_exists($key, $richText)) return '';
        }

        $alt = (!empty($richText['alt']) ? ' alt="'.$richText['alt'].'"' : '');
        $width = (!empty($richText['dimensions']['width']) ? ' width="'.$richText['dimensions']['width'].'"' : '');
        $height = (!empty($richText['dimensions']['height']) ? ' height="'.$richText['dimensions']['height'].'"' : '');


        return '<img src="'.$richText['url'].'" '.$alt.$width.$height.' />';

    }
private static function asImageBlock(array $richText) {

        // Check if the value is a image object:
        foreach(['dimensions', 'alt','url'] as $key) {
            if(!key_exists($key, $richText)) return '';
        }

        $alt = (!empty($richText['alt']) ? ' alt="'.$richText['alt'].'"' : '');
        $width = (!empty($richText['dimensions']['width']) ? ' width="'.$richText['dimensions']['width'].'"' : '');
        $height = (!empty($richText['dimensions']['height']) ? ' height="'.$richText['dimensions']['height'].'"' : '');


        return '<img src="'.$richText['url'].'" '.$alt.$width.$height.' />';

    }
@param array $richText

@return string