Output   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 62
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 3 1
A getName() 0 3 1
A toDMN() 0 3 1
A getType() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace SteffenBrand\DmnDecisionTables\Model;
4
5
/**
6
 * Class Output
7
 * @package SteffenBrand\DmnDecisionTables\Model
8
 */
9
class Output implements DmnConvertibleInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $label;
15
16
    /**
17
     * @var string
18
     */
19
    private $name;
20
21
    /**
22
     * @var string
23
     */
24
    private $type;
25
26
    /**
27
     * Input constructor.
28
     * @param string $label
29
     * @param string $name
30
     * @param string $type
31
     */
32
    public function __construct($label, $name, $type)
33
    {
34
        $this->label = $label;
35
        $this->name = $name;
36
        $this->type = $type;
37
    }
38
39
    /**
40
     * Returns an XML representation of an output.
41
     *
42
     * @return string
43
     */
44
    public function toDMN()
45
    {
46
        return '<output id="' . uniqid('output') . '" label="' . $this->label . '" name="' . $this->name . '" typeRef="' . $this->type . '"/>';
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getLabel()
53
    {
54
        return $this->label;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getName()
61
    {
62
        return $this->name;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getType()
69
    {
70
        return $this->type;
71
    }
72
}