Deg::addDataElement()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Fhp;
4
5
/**
6
 * Class Deg (Data Element Group)
7
 * @package Fhp
8
 */
9
class Deg
10
{
11
    /** @var array  */
12
    protected $dataElements = array();
13
14
    /**
15
     * Adds a data element to the data element group.
16
     *
17
     * @param mixed $value
18
     */
19 13
    public function addDataElement($value)
20
    {
21 13
        $this->dataElements[] = $value;
22 13
    }
23
24 13
    public function toString()
25
    {
26 13
        return (string) implode(':', $this->dataElements);
27
    }
28
29
    /**
30
     * @return string
31
     */
32 13
    public function __toString()
33
    {
34 13
        return $this->toString();
35
    }
36
}
37