Attribute::setValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/*
4
 * This file is part of the doctrineviz package
5
 *
6
 * Copyright (c) 2017 Pierre Hennequart
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * Feel free to edit as you please, and have fun.
12
 *
13
 * @author Pierre Hennequart <[email protected]>
14
 */
15
16
declare(strict_types=1);
17
18
namespace Janalis\Doctrineviz\Graphviz;
19
20
class Attribute implements AttributeInterface
21
{
22
    /** @var string */
23
    protected $id;
24
25
    /** @var string */
26
    protected $value;
27
28
    /**
29
     * @return string
30
     */
31
    public function __toString()
32
    {
33
        return "$this->id=\"$this->value\"";
34
    }
35
36
    /**
37
     * Attribute constructor.
38
     *
39
     * @param string $id
40
     * @param string $value
41
     */
42
    public function __construct(string $id, string $value)
43
    {
44
        $this->id = $id;
45
        $this->value = $value;
46
    }
47
48
    /**
49
     * Get id.
50
     *
51
     * @return string
52
     */
53
    public function getId(): string
54
    {
55
        return $this->id;
56
    }
57
58
    /**
59
     * Set id.
60
     *
61
     * @param string $id
62
     */
63
    public function setId(string $id): void
64
    {
65
        $this->id = $id;
66
    }
67
68
    /**
69
     * Get value.
70
     *
71
     * @return string
72
     */
73
    public function getValue(): string
74
    {
75
        return $this->value;
76
    }
77
78
    /**
79
     * Set value.
80
     *
81
     * @param string $value
82
     */
83
    public function setValue(string $value): void
84
    {
85
        $this->value = $value;
86
    }
87
}
88