Skip to content

Commit 2e95887

Browse files
committed
Fix form component inconsistencies
1 parent 926246b commit 2e95887

8 files changed

+182
-206
lines changed

src/Symfony/Component/Form/Button.php

Lines changed: 24 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,7 @@ public function get($name)
154154
}
155155

156156
/**
157-
* Unsupported method.
158-
*
159-
* @param string $name
160-
*
161-
* @return bool Always returns false
157+
* {@inheritdoc}
162158
*/
163159
public function has($name)
164160
{
@@ -196,13 +192,7 @@ public function getErrors($deep = false, $flatten = true)
196192
}
197193

198194
/**
199-
* Unsupported method.
200-
*
201-
* This method should not be invoked.
202-
*
203-
* @param mixed $modelData
204-
*
205-
* @return $this
195+
* {@inheritdoc}
206196
*/
207197
public function setData($modelData)
208198
{
@@ -211,71 +201,63 @@ public function setData($modelData)
211201
}
212202

213203
/**
214-
* Unsupported method.
204+
* {@inheritdoc}
215205
*/
216206
public function getData()
217207
{
218208
return null;
219209
}
220210

221211
/**
222-
* Unsupported method.
212+
* {@inheritdoc}
223213
*/
224214
public function getNormData()
225215
{
226216
return null;
227217
}
228218

229219
/**
230-
* Unsupported method.
220+
* {@inheritdoc}
231221
*/
232222
public function getViewData()
233223
{
234224
return null;
235225
}
236226

237227
/**
238-
* Unsupported method.
239-
*
240-
* @return array Always returns an empty array
228+
* {@inheritdoc}
241229
*/
242230
public function getExtraData()
243231
{
244232
return [];
245233
}
246234

247235
/**
248-
* Returns the button's configuration.
249-
*
250-
* @return FormConfigInterface The configuration instance
236+
* {@inheritdoc}
251237
*/
252238
public function getConfig()
253239
{
254240
return $this->config;
255241
}
256242

257243
/**
258-
* Returns whether the button is submitted.
259-
*
260-
* @return bool true if the button was submitted
244+
* {@inheritdoc}
261245
*/
262246
public function isSubmitted()
263247
{
264248
return $this->submitted;
265249
}
266250

267251
/**
268-
* Returns the name by which the button is identified in forms.
269-
*
270-
* @return string The name of the button
252+
* {@inheritdoc}
271253
*/
272254
public function getName()
273255
{
274256
return $this->config->getName();
275257
}
276258

277259
/**
278-
* Unsupported method.
260+
* {@inheritdoc}
279261
*/
280262
public function getPropertyPath()
281263
{
@@ -285,6 +267,8 @@ public function getPropertyPath()
285267
/**
286268
* Unsupported method.
287269
*
270+
* This method should not be invoked.
271+
*
288272
* @throws BadMethodCallException
289273
*/
290274
public function addError(FormError $error)
@@ -293,19 +277,15 @@ public function addError(FormError $error)
293277
}
294278

295279
/**
296-
* Unsupported method.
297-
*
298-
* @return bool Always returns true
280+
* {@inheritdoc}
299281
*/
300282
public function isValid()
301283
{
302284
return true;
303285
}
304286

305287
/**
306-
* Unsupported method.
307-
*
308-
* @return bool Always returns false
288+
* {@inheritdoc}
309289
*/
310290
public function isRequired()
311291
{
@@ -325,27 +305,23 @@ public function isDisabled()
325305
}
326306

327307
/**
328-
* Unsupported method.
329-
*
330-
* @return bool Always returns true
308+
* {@inheritdoc}
331309
*/
332310
public function isEmpty()
333311
{
334312
return true;
335313
}
336314

337315
/**
338-
* Unsupported method.
339-
*
340-
* @return bool Always returns true
316+
* {@inheritdoc}
341317
*/
342318
public function isSynchronized()
343319
{
344320
return true;
345321
}
346322

347323
/**
348-
* Unsupported method.
324+
* {@inheritdoc}
349325
*/
350326
public function getTransformationFailure()
351327
{
@@ -355,6 +331,8 @@ public function getTransformationFailure()
355331
/**
356332
* Unsupported method.
357333
*
334+
* This method should not be invoked.
335+
*
358336
* @throws BadMethodCallException
359337
*/
360338
public function initialize()
@@ -365,6 +343,8 @@ public function initialize()
365343
/**
366344
* Unsupported method.
367345
*
346+
* This method should not be invoked.
347+
*
368348
* @param mixed $request
369349
*
370350
* @throws BadMethodCallException
@@ -375,14 +355,7 @@ public function handleRequest($request = null)
375355
}
376356

377357
/**
378-
* Submits data to the button.
379-
*
380-
* @param string|null $submittedData Not used
381-
* @param bool $clearMissing Not used
382-
*
383-
* @return $this
384-
*
385-
* @throws Exception\AlreadySubmittedException if the button has already been submitted
358+
* {@inheritdoc}
386359
*/
387360
public function submit($submittedData, $clearMissing = true)
388361
{
@@ -432,19 +405,15 @@ public function createView(FormView $parent = null)
432405
}
433406

434407
/**
435-
* Unsupported method.
436-
*
437-
* @return int Always returns 0
408+
* {@inheritdoc}
438409
*/
439410
public function count()
440411
{
441412
return 0;
442413
}
443414

444415
/**
445-
* Unsupported method.
446-
*
447-
* @return \EmptyIterator Always returns an empty iterator
416+
* {@inheritdoc}
448417
*/
449418
public function getIterator()
450419
{

0 commit comments

Comments
 (0)