1 | <?php |
||
24 | class FieldSet extends AbstractCollection implements ContainerInterface |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $settings = []; |
||
31 | |||
32 | /** |
||
33 | * Add attribute manipulation methods |
||
34 | */ |
||
35 | use AttributesAwareMethods; |
||
36 | |||
37 | /** |
||
38 | * Add render capabilities to element |
||
39 | */ |
||
40 | use RenderAwareMethods; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $name; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $value; |
||
51 | |||
52 | /** |
||
53 | * @var bool |
||
54 | */ |
||
55 | protected $rendering = false; |
||
56 | |||
57 | /** |
||
58 | * Checks if all elements are valid |
||
59 | * |
||
60 | * @return mixed |
||
61 | */ |
||
62 | 4 | public function isValid() |
|
75 | |||
76 | /** |
||
77 | * Adds an element to the container |
||
78 | * |
||
79 | * @param ElementInterface $element |
||
80 | * |
||
81 | * @return self|$this|ContainerInterface |
||
82 | */ |
||
83 | 52 | public function add(ElementInterface $element) |
|
92 | |||
93 | /** |
||
94 | * Gets element by name |
||
95 | * |
||
96 | * @param string $name |
||
97 | * |
||
98 | * @return null|ElementInterface|InputInterface |
||
99 | */ |
||
100 | 14 | public function get($name) |
|
120 | |||
121 | /** |
||
122 | * Sets the values form matched elements |
||
123 | * |
||
124 | * The passed array is a key/value array where keys are used to |
||
125 | * match against element names. It will only assign the value to |
||
126 | * the marched element only. |
||
127 | * |
||
128 | * @param array $values |
||
129 | * |
||
130 | * @return self|$this|ContainerInterface |
||
131 | */ |
||
132 | 2 | public function setValues(array $values) |
|
141 | |||
142 | /** |
||
143 | * Gets the element value |
||
144 | * |
||
145 | * This value here is just a string and it can be the content that |
||
146 | * goes inside <label> tags for example. |
||
147 | * |
||
148 | * @return mixed |
||
149 | */ |
||
150 | 4 | public function getValue() |
|
154 | |||
155 | /** |
||
156 | * Returns element name. |
||
157 | * |
||
158 | * This name can be null however a form or field set will use it |
||
159 | * in the FormInterface::get() method to retrieve it. |
||
160 | * |
||
161 | * @return mixed |
||
162 | */ |
||
163 | 36 | public function getName() |
|
167 | |||
168 | /** |
||
169 | * Set element name |
||
170 | * |
||
171 | * @param string $name |
||
172 | * @return $this|self|FieldSet |
||
173 | */ |
||
174 | 32 | public function setName($name) |
|
179 | |||
180 | /** |
||
181 | * Sets the value or content of the element |
||
182 | * |
||
183 | * @param mixed $value |
||
184 | * |
||
185 | * @return self|$this|FieldSet |
||
186 | */ |
||
187 | 4 | public function setValue($value) |
|
192 | |||
193 | /** |
||
194 | * Adds an element to the collection |
||
195 | * |
||
196 | * @param mixed $offset unused |
||
197 | * @param ElementInterface $value |
||
198 | */ |
||
199 | 2 | public function offsetSet($offset, $value) |
|
203 | |||
204 | /** |
||
205 | * Gets the HTML renderer for this element |
||
206 | * |
||
207 | * @return RendererInterface |
||
208 | */ |
||
209 | 2 | protected function getRenderer() |
|
213 | |||
214 | /** |
||
215 | * Runs validation chain in all its elements |
||
216 | * |
||
217 | * @return self|$this|ElementInterface |
||
218 | */ |
||
219 | 4 | public function validate() |
|
220 | { |
||
221 | 4 | foreach ($this as $element) { |
|
222 | |||
223 | if ( |
||
224 | 4 | $element instanceof ValidationAwareInterface || |
|
225 | $element instanceof ContainerInterface |
||
226 | 4 | ) { |
|
227 | 4 | $element->validate(); |
|
228 | 4 | } |
|
229 | 4 | } |
|
230 | 4 | return $this; |
|
231 | } |
||
232 | |||
233 | /** |
||
234 | * Set other input settings |
||
235 | * |
||
236 | * @param array $settings |
||
237 | * @return self|AbstractElement |
||
238 | */ |
||
239 | public function setSettings(array $settings) |
||
244 | |||
245 | /** |
||
246 | * Set rendering state |
||
247 | * |
||
248 | * @param bool $state |
||
249 | * |
||
250 | * @return FieldSet |
||
251 | */ |
||
252 | 4 | public function setRendering($state) |
|
257 | } |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.