8000 [Form] fixed and added phpDoc · samswitz/symfony@a523823 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a523823

Browse files
committed
[Form] fixed and added phpDoc
1 parent a1e6cfb commit a523823

11 files changed

+83
-105
lines changed

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class ORMQueryBuilderLoader implements EntityLoaderInterface
3333
/**
3434
* Construct an ORM Query Builder Loader
3535
*
36-
* @param QueryBuilder $queryBuilder
37-
* @param EntityManager $manager
38-
* @param string $class
36+
* @param QueryBuilder|\Closure $queryBuilder
37+
* @param EntityManager $manager
38+
* @param string $class
3939
*/
4040
public function __construct($queryBuilder, $manager = null, $class = null)
4141
{

src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver)
155155
* @param ObjectManager $manager
156156
* @param mixed $queryBuilder
157157
* @param string $class
158+
*
158159
* @return EntityLoaderInterface
159160
*/
160161
abstract public function getLoader(ObjectManager $manager, $queryBuilder, $class);

src/Symfony/Component/Form/Event/DataEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public function getForm()
5050
/**
5151
* Returns the data associated with this event.
5252
*
53-
* @return type
53+
* @return mixed
5454
*/
5555
public function getData()
5656
{
5757
return $this->data;
5858
}
5959

6060
/**
61-
* Allows updating with some filtered data
61+
* Allows updating with some filtered data.
6262
*
6363
* @param mixed $data
6464
*/

src/Symfony/Component/Form/Form.php

Lines changed: 37 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,15 @@ public function __clone()
164164
}
165165

166166
/**
167-
* Returns the configuration of the form.
168-
*
169-
* @return FormConfigInterface The form's configuration.
167+
* {@inheritdoc}
170168
*/
171169
public function getConfig()
172170
{
173171
return $this->config;
174172
}
175173

176174
/**
177-
* Returns the name by which the form is identified in forms.
178-
*
179-
* @return string The name of the form.
175+
* {@inheritdoc}
180176
*/
181177
public function getName()
182178
{
@@ -247,11 +243,7 @@ public function isDisabled()
247243
}
248244

249245
/**
250-
* Sets the parent form.
251-
*
252-
* @param FormInterface $parent The parent form
253-
*
254-
* @return Form The current form
246+
* {@inheritdoc}
255247
*/
256248
public function setParent(FormInterface $parent = null)
257249
{
@@ -269,39 +261,31 @@ public function setParent(FormInterface $parent = null)
269261
}
270262

271263
/**
272-
* Returns the parent form.
273-
*
274-
* @return FormInterface The parent form
264+
* {@inheritdoc}
275265
*/
276266
public function getParent()
277267
{
278268
return $this->parent;
279269
}
280270

281271
/**
282-
* Returns whether the form has a parent.
283-
*
284-
* @return Boolean
272+
* {@inheritdoc}
285273
*/
286274
public function hasParent()
287275
{
288276
return null !== $this->parent;
289277
}
290278

291279
/**
292-
* Returns the root of the form tree.
293-
*
294-
* @return FormInterface The root of the tree
280+
* {@inheritdoc}
295281
*/
296282
public function getRoot()
297283
{
298284
return $this->parent ? $this->parent->getRoot() : $this;
299285
}
300286

301287
/**
302-
* Returns whether the form is the root of the form tree.
303-
*
304-
* @return Boolean
288+
* {@inheritdoc}
305289
*/
306290
public function isRoot()
307291
{
@@ -339,11 +323,7 @@ public function getAttribute($name)
339323
}
340324

341325
/**
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}
347327
*/
348328
public function setData($modelData)
349329
{
@@ -440,9 +420,7 @@ public function setData($modelData)
440420
}
441421

442422
/**
443-
* Returns the data in the format needed for the underlying object.
444-
*
445-
* @return mixed
423+
* {@inheritdoc}
446424
*/
447425
public function getData()
448426
{
@@ -454,11 +432,7 @@ public function getData()
454432
}
455433

456434
/**
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}
462436
*/
463437
public function getNormData()
464438
{
@@ -470,9 +444,7 @@ public function getNormData()
470444
}
471445

472446
/**
473-
* Returns the data transformed by the value transformer.
474-
*
475-
* @return string
447+
* {@inheritdoc}
476448
*/
477449
public function getViewData()
478450
{
@@ -497,23 +469,15 @@ public function getClientData()
497469
}
498470

499471
/**
500-
* Returns the extra data.
501-
*
502-
* @return array The bound data which do not belong to a child
472+
* {@inheritdoc}
503473
*/
504474
public function getExtraData()
505475
{
506476
return $this->extraData;
507477
}
508478

509479
/**
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}
517481
*/
518482
public function bind($submittedData)
519483
{
@@ -677,11 +641,7 @@ public function bindRequest(Request $request)
677641
}
678642

679643
/**
680-
* Adds an error to this form.
681-
*
682-
* @param FormError $error
683-
*
684-
* @return Form The current form
644+
* {@inheritdoc}
685645
*/
686646
public function addError(FormError $error)
687647
{
@@ -708,29 +668,23 @@ public function getErrorBubbling()
708668
}
709669

710670
/**
711-
* Returns whether the form is bound.
712-
*
713-
* @return Boolean true if the form is bound to input values, false otherwise
671+
* {@inheritdoc}
714672
*/
715673
public function isBound()
716674
{
717675
return $this->bound;
718676
}
719677

720678
/**
721-
* Returns whether the data in the different formats is synchronized.
722-
*
723-
* @return Boolean
679+
* {@inheritdoc}
724680
*/
725681
public function isSynchronized()
726682
{
727683
return $this->synchronized;
728684
}
729685

730686
/**
731-
* Returns whether the form is empty.
732-
*
733-
* @return Boolean
687+
* {@inheritdoc}
734688
*/
735689
public function isEmpty()
736690
{
@@ -744,9 +698,7 @@ public function isEmpty()
744698
}
745699

746700
/**
747-
* Returns whether the form is valid.
748-
*
749-
* @return Boolean
701+
* {@inheritdoc}
750702
*/
751703
public function isValid()
752704
{
@@ -783,9 +735,7 @@ public function hasErrors()
783735
}
784736

785737
/**
786-
* Returns all errors.
787-
*
788-
* @return array An array of FormError instances that occurred during binding
738+
* {@inheritdoc}
789739
*/
790740
public function getErrors()
791741
{
@@ -962,23 +912,25 @@ public function get($name)
962912
}
963913

964914
/**
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).
966916
*
967917
* @param string $name The name of the child
968918
*
969-
* @return Boolean true if the widget exists, false otherwise
919+
* @return Boolean
970920
*/
971921
public function offsetExists($name)
972922
{
973923
return $this->has($name);
974924
}
975925

976926
/**
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
978930
*
979-
* @param string $name The offset of the value to get
931+
* @return FormInterface The child form
980932
*
981-
* @return FormInterface A form instance
933+
* @throws \InvalidArgumentException If the named child does not exist.
982934
*/
983935
public function offsetGet($name)
984936
{
@@ -989,7 +941,12 @@ public function offsetGet($name)
989941
* Adds a child to the form (implements the \ArrayAccess interface).
990942
*
991943
* @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()
993950
*/
994951
public function offsetSet($name, $child)
995952
{
@@ -999,7 +956,9 @@ public function offsetSet($name, $child)
999956
/**
1000957
* Removes the child with the given name from the form (implements the \ArrayAccess interface).
1001958
*
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.
1003962
*/
1004963
public function offsetUnset($name)
1005964
{
@@ -1043,7 +1002,7 @@ public function createView(FormView $parent = null)
10431002
*
10441003
* @param mixed $value The value to transform
10451004
*
1046-
* @return string
1005+
* @return mixed
10471006
*/
10481007
private function modelToNorm($value)
10491008
{
@@ -1077,7 +1036,7 @@ private function normToModel($value)
10771036
*
10781037
* @param mixed $value The value to transform
10791038
*
1080-
* @return string
1039+
* @return mixed
10811040
*/
10821041
private function normToView($value)
10831042
{

src/Symfony/Component/Form/FormBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class FormBuilder extends FormConfigBuilder implements \IteratorAggregate, FormB
4444
private $unresolvedChildren = array();
4545

4646
/**
47-
* The parent of this builder
47+
* The parent of this builder.
48+
*
4849
* @var FormBuilder
4950
*/
5051
private $parent;

src/Symfony/Component/Form/FormConfigBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ class FormConfigBuilder implements FormConfigBuilderInterface
143143
* @param EventDispatcherInterface $dispatcher The event dispatcher
144144
* @param array $options The form options
145145
*
146-
* @throws UnexpectedTypeException If the name is not a string.
147146
* @throws \InvalidArgumentException If the data class is not a valid class or if
148147
* the name contains invalid characters.
149148
*/

src/Symfony/Component/Form/FormConfigBuilderInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public function setRequired($required);
162162
/**
163163
* Sets the property path that the form should be mapped to.
164164
*
165-
* @param string|PropertyPath $propertyPath The property path or null if the path
166-
* should be set automatically based on
167-
* the form's name.
165+
* @param null|string|PropertyPathInterface $propertyPath The property path or null if the path
166+
* should be set automatically based on
167+
* the form's name.
168168
*
169169
* @return self The configuration object.
170170
*/
@@ -184,7 +184,7 @@ public function setMapped($mapped);
184184
* Sets whether the form's data should be modified by reference.
185185
*
186186
* @param Boolean $byReference Whether the data should be
187-
* modified by reference.
187+
* modified by reference.
188188
*
189189
* @return self The configuration object.
190190
*/

src/Symfony/Component/Form/FormConfigInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getName();
3535
/**
3636
* Returns the property path that the form should be mapped to.
3737
*
38-
* @return Util\PropertyPath The property path.
38+
* @return null|Util\PropertyPathInterface The property path.
3939
*/
4040
public function getPropertyPath();
4141

0 commit comments

Comments
 (0)
0