Zenc_EmailLogger_Block_Render_Html::_toHtml()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 13
rs 9.4285
cc 3
eloc 9
nc 3
nop 0
1
<?php
2
3
class Zenc_EmailLogger_Block_Render_Html
4
    extends Mage_Core_Block_Abstract
5
    implements Zenc_EmailLogger_Block_Render_Interface
6
{
7
    public function getContentType()
8
    {
9
        return 'text/html';
10
    }
11
12
    protected function _toHtml()
13
    {
14
        $data = $this->getValue();
15
16
        switch (true) {
17
            case !empty($data['body_html']):
18
                return $data['body_html'];
19
            case !empty($data['body_text']):
20
                return $data['body_text'];
21
            default:
22
                return 'Email has no visible content';
23
        }
24
    }
25
}
26