ClosedElement   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

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\Tokens\Element;
6
use Groundskeeper\Tokens\Token;
7
8
abstract class ClosedElement extends Element
9
{
10
    /**
11
     * Reimplement appendChild so that no children can be added.
12
     */
13 1
    public function appendChild(Token $token)
14
    {
15 1
        return $this;
16
    }
17
18
    /**
19
     * Reimplement prependChild so that no children can be added.
20
     */
21 1
    public function prependChild(Token $token)
22
    {
23 1
        return $this;
24
    }
25
26
    /**
27
     * Required by the Token interface.
28
     */
29 47
    public function toHtml(string $prefix, string $suffix) : string
30
    {
31 47
        return $this->buildStartTag($prefix, $suffix);
32
    }
33
}
34