Completed
Push — master ( 3f79e5...1ec99b )
by Kevin
02:42
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 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
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\ElementTypes;
4
5
use Groundskeeper\Configuration;
6
use Groundskeeper\Tokens\Element;
7
use Groundskeeper\Tokens\Token;
8
9
class ClosedElement extends Element
10
{
11
    /**
12
     * Reimplement appendChild so that no children can be added.
13
     */
14
    public function appendChild(Token $token)
15
    {
16
        return $this;
17
    }
18
19
    /**
20
     * Reimplement prependChild so that no children can be added.
21
     */
22
    public function prependChild(Token $token)
23
    {
24
        return $this;
25
    }
26
27
    /**
28
     * Required by the Token interface.
29
     */
30 7
    public function toHtml($prefix, $suffix)
31
    {
32 7
        return $this->buildStartTag($prefix, $suffix);
33
    }
34
}
35