Passed
Push — master ( c34c78...bc30de )
by kill
03:55
created

Dom   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 16
ccs 10
cts 10
cp 1
rs 10
c 1
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A init() 0 5 1
A release() 0 4 1
1
<?php
2
/**
3
 * Created by rozbo at 2017/4/17 下午6:34
4
 */
5
6
namespace puck\helpers;
7
8
use DiDom\Document;
9
10
class Dom extends Document {
11 1
    public function __construct() {
12 1
        $this->init();
13 1
    }
14
15 3
    public function init($encoding = 'UTF-8') {
16 3
        $this->document = new \DOMDocument('1.0', $encoding);
17 3
        $this->preserveWhiteSpace(false);
18 3
        return $this;
19
    }
20
21 2
    public function release() {
22 2
        unset($this->document);
23 2
        return $this;
24
    }
25
}