ClosedElement::appendChild()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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