@@ -164,19 +164,15 @@ public function __clone()
164
164
}
165
165
166
166
/**
167
- * Returns the configuration of the form.
168
- *
169
- * @return FormConfigInterface The form's configuration.
167
+ * {@inheritdoc}
170
168
*/
171
169
public function getConfig ()
172
170
{
173
171
return $ this ->config ;
174
172
}
175
173
176
174
/**
177
- * Returns the name by which the form is identified in forms.
178
- *
179
- * @return string The name of the form.
175
+ * {@inheritdoc}
180
176
*/
181
177
public function getName ()
182
178
{
@@ -247,11 +243,7 @@ public function isDisabled()
247
243
}
248
244
249
245
/**
250
- * Sets the parent form.
251
- *
252
- * @param FormInterface $parent The parent form
253
- *
254
- * @return Form The current form
246
+ * {@inheritdoc}
255
247
*/
256
248
public function setParent (FormInterface $ parent = null )
257
249
{
@@ -269,39 +261,31 @@ public function setParent(FormInterface $parent = null)
269
261
}
270
262
271
263
/**
272
- * Returns the parent form.
273
- *
274
- * @return FormInterface The parent form
264
+ * {@inheritdoc}
275
265
*/
276
266
public function getParent ()
277
267
{
278
268
return $ this ->parent ;
279
269
}
280
270
281
271
/**
282
- * Returns whether the form has a parent.
283
- *
284
- * @return Boolean
272
+ * {@inheritdoc}
285
273
*/
286
274
public function hasParent ()
287
275
{
288
276
return null !== $ this ->parent ;
289
277
}
290
278
291
279
/**
292
- * Returns the root of the form tree.
293
- *
294
- * @return FormInterface The root of the tree
280
+ * {@inheritdoc}
295
281
*/
296
282
public function getRoot ()
297
283
{
298
284
return $ this ->parent ? $ this ->parent ->getRoot () : $ this ;
299
285
}
300
286
301
287
/**
302
- * Returns whether the form is the root of the form tree.
303
- *
304
- * @return Boolean
288
+ * {@inheritdoc}
305
289
*/
306
290
public function isRoot ()
307
291
{
@@ -339,11 +323,7 @@ public function getAttribute($name)
339
323
}
340
324
341
325
/**
342
- * Updates the form with default data.
343
- *
344
- * @param mixed $modelData The data formatted as expected for the underlying object
345
- *
346
- * @return Form The current form
326
+ * {@inheritdoc}
347
327
*/
348
328
public function setData ($ modelData )
349
329
{
@@ -440,9 +420,7 @@ public function setData($modelData)
440
420
}
441
421
442
422
/**
443
- * Returns the data in the format needed for the underlying object.
444
- *
445
- * @return mixed
423
+ * {@inheritdoc}
446
424
*/
447
425
public function getData ()
448
426
{
@@ -454,11 +432,7 @@ public function getData()
454
432
}
455
433
456
434
/**
457
- * Returns the normalized data of the form.
458
- *
459
- * @return mixed When the form is not bound, the default data is returned.
460
- * When the form is bound, the normalized bound data is
461
- * returned if the form is valid, null otherwise.
435
+ * {@inheritdoc}
462
436
*/
463
437
public function getNormData ()
464
438
{
@@ -470,9 +444,7 @@ public function getNormData()
470
444
}
471
445
472
446
/**
473
- * Returns the data transformed by the value transformer.
474
- *
475
- * @return string
447
+ * {@inheritdoc}
476
448
*/
477
449
public function getViewData ()
478
450
{
@@ -497,23 +469,15 @@ public function getClientData()
497
469
}
498
470
499
471
/**
500
- * Returns the extra data.
501
- *
502
- * @return array The bound data which do not belong to a child
472
+ * {@inheritdoc}
503
473
*/
504
474
public function getExtraData ()
505
475
{
506
476
return $ this ->extraData ;
507
477
}
508
478
509
479
/**
510
- * Binds data to the form, transforms and validates it.
511
- *
512
- * @param string|array $submittedData The data
513
- *
514
- * @return Form The current form
515
- *
516
- * @throws UnexpectedTypeException
480
+ * {@inheritdoc}
517
481
*/
518
482
public function bind ($ submittedData )
519
483
{
@@ -677,11 +641,7 @@ public function bindRequest(Request $request)
677
641
}
678
642
679
643
/**
680
- * Adds an error to this form.
681
- *
682
- * @param FormError $error
683
- *
684
- * @return Form The current form
644
+ * {@inheritdoc}
685
645
*/
686
646
public function addError (FormError $ error )
687
647
{
@@ -708,29 +668,23 @@ public function getErrorBubbling()
708
668
}
709
669
710
670
/**
711
- * Returns whether the form is bound.
712
- *
713
- * @return Boolean true if the form is bound to input values, false otherwise
671
+ * {@inheritdoc}
714
672
*/
715
673
public function isBound ()
716
674
{
717
675
return $ this ->bound ;
718
676
}
719
677
720
678
/**
721
- * Returns whether the data in the different formats is synchronized.
722
- *
723
- * @return Boolean
679
+ * {@inheritdoc}
724
680
*/
725
681
public function isSynchronized ()
726
682
{
727
683
return $ this ->synchronized ;
728
684
}
729
685
730
686
/**
731
- * Returns whether the form is empty.
732
- *
733
- * @return Boolean
687
+ * {@inheritdoc}
734
688
*/
735
689
public function isEmpty ()
736
690
{
@@ -744,9 +698,7 @@ public function isEmpty()
744
698
}
745
699
746
700
/**
747
- * Returns whether the form is valid.
748
- *
749
- * @return Boolean
701
+ * {@inheritdoc}
750
702
*/
751
703
public function isValid ()
752
704
{
@@ -783,9 +735,7 @@ public function hasErrors()
783
735
}
784
736
785
737
/**
786
- * Returns all errors.
787
- *
788
- * @return array An array of FormError instances that occurred during binding
738
+ * {@inheritdoc}
789
739
*/
790
740
public function getErrors ()
791
741
{
@@ -962,23 +912,25 @@ public function get($name)
962
912
}
963
913
964
914
/**
965
- * Returns true if the child exists (implements the \ArrayAccess interface).
915
+ * Returns whether a child with the given name exists (implements the \ArrayAccess interface).
966
916
*
967
917
* @param string $name The name of the child
968
918
*
969
- * @return Boolean true if the widget exists, false otherwise
919
+ * @return Boolean
970
920
*/
971
921
public function offsetExists ($ name )
972
922
{
973
923
return $ this ->has ($ name );
974
924
}
975
925
976
926
/**
977
- * Returns the form child associated with the name (implements the \ArrayAccess interface).
927
+ * Returns the child with the given name (implements the \ArrayAccess interface).
928
+ *
929
+ * @param string $name The name of the child
978
930
*
979
- * @param string $name The offset of the value to get
931
+ * @return FormInterface The child form
980
932
*
981
- * @return FormInterface A form instance
933
+ * @throws \InvalidArgumentException If the named child does not exist.
982
934
*/
983
935
public function offsetGet ($ name )
984
936
{
@@ -989,7 +941,12 @@ public function offsetGet($name)
989
941
* Adds a child to the form (implements the \ArrayAccess interface).
990
942
*
991
943
* @param string $name Ignored. The name of the child is used.
992
- * @param FormInterface $child The child to be added
944
+ * @param FormInterface $child The child to be added.
945
+ *
946
+ * @throws AlreadyBoundException If the form has already been bound.
947
+ * @throws FormException When trying to add a child to a non-compound form.
948
+ *
949
+ * @see self::add()
993
950
*/
994
951
public function offsetSet ($ name , $ child )
995
952
{
@@ -999,7 +956,9 @@ public function offsetSet($name, $child)
999
956
/**
1000
957
* Removes the child with the given name from the form (implements the \ArrayAccess interface).
1001
958
*
1002
- * @param string $name The name of the child to be removed
959
+ * @param string $name The name of the child to remove
960
+ *
961
+ * @throws AlreadyBoundException If the form has already been bound.
1003
962
*/
1004
963
public function offsetUnset ($ name )
1005
964
{
@@ -1043,7 +1002,7 @@ public function createView(FormView $parent = null)
1043
1002
*
1044
1003
* @param mixed $value The value to transform
1045
1004
*
1046
- * @return string
1005
+ * @return mixed
1047
1006
*/
1048
1007
private function modelToNorm ($ value )
1049
1008
{
@@ -1077,7 +1036,7 @@ private function normToModel($value)
1077
1036
*
1078
1037
* @param mixed $value The value to transform
1079
1038
*
1080
- * @return string
1039
+ * @return mixed
1081
1040
*/
1082
1041
private function normToView ($ value )
1083
1042
{
0 commit comments