Completed
Push — master ( a9adfd...b66e97 )
by Kevin
02:14
created

ClosedElement::getChildren()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Groundskeeper\Tokens\Elements;
4
5
class ClosedElement extends Element
6
{
7
    public function getChildren()
8
    {
9
        return array();
10
    }
11
12
    public function addChild(Token $token)
13
    {
14
        return $this;
15
    }
16
17
    public function removeChild(Token $token)
18
    {
19
        return true;
20
    }
21
22 View Code Duplication
    public function toString($prefix = '', $suffix = '')
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        $output = $prefix . '<' . $this->name;
0 ignored issues
show
Bug introduced by
The property name cannot be accessed from this context as it is declared private in class Groundskeeper\Tokens\Elements\Element.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
25
        foreach ($this->attributes as $key => $value) {
0 ignored issues
show
Bug introduced by
The property attributes cannot be accessed from this context as it is declared private in class Groundskeeper\Tokens\Elements\Element.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
26
            $output .= ' ' . $key;
27
            if (is_string($value)) {
28
                $output .= '="' . $value . '"';
29
            }
30
        }
31
32
        return $output . '/>' . $suffix;
33
    }
34
}
35