1 | <?php |
||
25 | class Property |
||
26 | { |
||
27 | /** |
||
28 | * The value of the Property. |
||
29 | * |
||
30 | * @var ValueInterface |
||
31 | */ |
||
32 | protected $value; |
||
33 | |||
34 | /** |
||
35 | * The params of the Property. |
||
36 | * |
||
37 | * @var ParameterBag |
||
38 | */ |
||
39 | protected $parameterBag; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $name; |
||
45 | |||
46 | /** |
||
47 | * @param $name |
||
48 | * @param $value |
||
49 | * @param array $params |
||
50 | */ |
||
51 | 51 | public function __construct($name, $value, $params = []) |
|
52 | { |
||
53 | 51 | $this->name = $name; |
|
54 | 51 | $this->setValue($value); |
|
55 | 51 | $this->parameterBag = new ParameterBag($params); |
|
56 | 51 | } |
|
57 | |||
58 | /** |
||
59 | * Renders an unfolded line. |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 32 | public function toLine() |
|
79 | |||
80 | /** |
||
81 | * Get all unfolded lines. |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | 19 | public function toLines() |
|
89 | |||
90 | /** |
||
91 | * @param string $name |
||
92 | * @param mixed $value |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | 1 | public function setParam($name, $value) |
|
102 | |||
103 | /** |
||
104 | * @param $name |
||
105 | */ |
||
106 | 1 | public function getParam($name) |
|
110 | |||
111 | /** |
||
112 | * @param mixed $value |
||
113 | * |
||
114 | * @return $this |
||
115 | * |
||
116 | * @throws \Exception |
||
117 | */ |
||
118 | 55 | public function setValue($value) |
|
134 | |||
135 | /** |
||
136 | * @return mixed |
||
137 | */ |
||
138 | 5 | public function getValue() |
|
142 | |||
143 | /** |
||
144 | * @return string |
||
145 | */ |
||
146 | 42 | public function getName(): string |
|
150 | } |
||
151 |