Completed
Push — master ( 6e9edd...3f79e5 )
by Kevin
02:25
created

ClosedElement   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 33.33%

Importance

Changes 5
Bugs 0 Features 2
Metric Value
wmc 3
c 5
b 0
f 2
lcom 0
cbo 1
dl 0
loc 26
ccs 2
cts 6
cp 0.3333
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A appendChild() 0 4 1
A prependChild() 0 4 1
A toHtml() 0 4 1
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
use Groundskeeper\Configuration;
6
use Groundskeeper\Tokens\Token;
7
8
class ClosedElement extends Element
9
{
10
    /**
11
     * Reimplement appendChild so that no children can be added.
12
     */
13
    public function appendChild(Token $token)
14
    {
15
        return $this;
16
    }
17
18
    /**
19
     * Reimplement prependChild so that no children can be added.
20
     */
21
    public function prependChild(Token $token)
22
    {
23
        return $this;
24
    }
25
26
    /**
27
     * Required by the Token interface.
28
     */
29 6
    public function toHtml($prefix, $suffix)
30
    {
31 6
        return $this->buildStartTag($prefix, $suffix);
32
    }
33
}
34