Template   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 46
c 0
b 0
f 0
wmc 3
cbo 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDocument() 0 4 1
A getMetadata() 0 4 1
1
<?php
2
namespace Goetas\Twital;
3
4
/**
5
 * This class represents a template.
6
 * A valid template is a {DOMDocument} with some additional metadata.
7
 *
8
 * @author Asmir Mustafic <[email protected]>
9
 *
10
 */
11
class Template
12
{
13
    /**
14
     * The template {DOMDocument}
15
     *
16
     * @var \DOMDocument
17
     */
18
    private $document;
19
20
    /**
21
     * Template metadatas
22
     *
23
     * @var mixed
24
     */
25
    private $metadata;
26
27
    /**
28
     * @param \DOMDocument $document The template {DOMDocument}
29
     * @param mixed $metadata Template metadatas
30
     */
31 488
    public function __construct(\DOMDocument $document, $metadata = null)
32
    {
33 488
        $this->document = $document;
34 488
        $this->metadata = $metadata;
35 488
    }
36
37
    /**
38
     * Returns the {DOMDocument} of a template
39
     *
40
     * @return \DOMDocument
41
     */
42 486
    public function getDocument()
43
    {
44 486
        return $this->document;
45
    }
46
47
    /**
48
     * Return template metadatas.
49
     *
50
     * @return mixed
51
     */
52 484
    public function getMetadata()
53
    {
54 484
        return $this->metadata;
55
    }
56
}
57