TextPage   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 8
lcom 2
cbo 1
dl 0
loc 51
rs 10
c 0
b 0
f 0
ccs 0
cts 37
cp 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A run() 0 8 1
A beginHeader() 0 4 1
A endHeader() 0 4 1
A beginFooter() 0 4 1
A endFooter() 0 4 1
A start() 0 5 1
A finish() 0 4 1
1
<?php
2
/**
3
 * Pluggable themes for Yii2
4
 *
5
 * @link      https://github.com/hiqdev/yii2-thememanager
6
 * @package   yii2-thememanager
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\thememanager\widgets;
12
13
/**
14
 * TextPage widget.
15
 * @author Andrii Vasyliev <[email protected]>
16
 */
17
class TextPage extends \yii\base\Widget
18
{
19
    protected $header;
20
21
    protected $footer;
22
23
    public function init()
24
    {
25
        $this->start();
26
    }
27
28
    public function run()
29
    {
30
        return $this->render('TextPage', [
31
            'content' => $this->finish(),
32
            'header' => $this->header,
33
            'footer' => $this->footer,
34
        ]);
35
    }
36
37
    public function beginHeader()
38
    {
39
        $this->start();
40
    }
41
42
    public function endHeader()
43
    {
44
        $this->header = $this->finish();
45
    }
46
47
    public function beginFooter()
48
    {
49
        $this->start();
50
    }
51
52
    public function endFooter()
53
    {
54
        $this->footer = $this->finish();
55
    }
56
57
    protected function start()
58
    {
59
        ob_start();
60
        ob_implicit_flush(false);
61
    }
62
63
    protected function finish()
64
    {
65
        return ob_get_clean();
66
    }
67
}
68