Completed
Push — master ( b59dfe...bf8cd7 )
by Klochok
02:38
created

TextPage   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

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
namespace hiqdev\thememanager\widgets;
4
5
class TextPage extends \yii\base\Widget
6
{
7
    protected $header;
8
9
    protected $footer;
10
11
    public function init()
12
    {
13
        $this->start();
14
    }
15
16
    public function run()
17
    {
18
        return $this->render('TextPage', [
19
            'content' => $this->finish(),
20
            'header' => $this->header,
21
            'footer' => $this->footer,
22
        ]);
23
    }
24
25
    public function beginHeader()
26
    {
27
        $this->start();
28
    }
29
30
    public function endHeader()
31
    {
32
        $this->header = $this->finish();
33
    }
34
35
    public function beginFooter()
36
    {
37
        $this->start();
38
    }
39
40
    public function endFooter()
41
    {
42
        $this->footer = $this->finish();
43
    }
44
45
    protected function start()
46
    {
47
        ob_start();
48
        ob_implicit_flush(false);
49
    }
50
51
    protected function finish()
52
    {
53
        return ob_get_clean();
54
    }
55
}
56