Zenc_EmailLogger_Block_Render_Html   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContentType() 0 4 1
A _toHtml() 0 13 3
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