8000 merged branch Tobion/form-phpdoc (PR #4353) · symfony/symfony@e4e3ce6 · GitHub
[go: up one dir, main page]

Skip to content

Commit e4e3ce6

Browse files
committed
merged branch Tobion/form-phpdoc (PR #4353)
Commits ------- 5d1b366 [Form] fix PhpDoc Discussion ---------- [Form] fix PhpDoc --------------------------------------------------------------------------- by travisbot at 2012-05-21T02:31:56Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1385372) (merged 5d1b366 into 1407f11). --------------------------------------------------------------------------- by vicb at 2012-05-21T05:44:03Z have you used inheritdoc (over inheritDoc) on purpose ? (I must admin I haven't followed the CS discussion very closely) --------------------------------------------------------------------------- by Tobion at 2012-05-21T16:16:48Z Yes, inheritdoc is used on symfony. It's also the recommended way of phpdoc itself (all lower-case).
2 parents 335d4ea + 5d1b366 commit e4e3ce6

13 files changed

+95
-244
lines changed

src/Symfony/Component/Form/AbstractExtension.php

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,7 @@ abstract class AbstractExtension implements FormExtensionInterface
4444
private $typeGuesserLoaded = false;
4545

4646
/**
47-
* Returns a type by name.
48-
*
49-
* @param string $name The name of the type
50-
*
51-
* @return FormTypeInterface The type
52-
*
53-
* @throws FormException if the given type is not supported by this extension
47+
* {@inheritdoc}
5448
*/
5549
public function getType($name)
5650
{
@@ -66,11 +60,7 @@ public function getType($name)
6660
}
6761

6862
/**
69-
* Returns whether the given type is supported.
70-
*
71-
* @param string $name The name of the type
72-
*
73-
* @return Boolean Whether the type is supported by this extension
63+
* {@inheritdoc}
7464
*/
7565
public function hasType($name)
7666
{
@@ -82,11 +72,7 @@ public function hasType($name)
8272
}
8373

8474
/**
85-
* Returns the extensions for the given type.
86-
*
87-
* @param string $name The name of the type
88-
*
89-
* @return array An array of extensions as FormTypeExtensionInterface instances
75+
* {@inheritdoc}
9076
*/
9177
public function getTypeExtensions($name)
9278
{
@@ -100,11 +86,7 @@ public function getTypeExtensions($name)
10086
}
10187

10288
/**
103-
* Returns whether this extension provides type extensions for the given type.
104-
*
105-
* @param string $name The name of the type
106-
*
107-
* @return Boolean Whether the given type has extensions
89+
* {@inheritdoc}
10890
*/
10991
public function hasTypeExtensions($name)
11092
{
@@ -116,9 +98,7 @@ public function hasTypeExtensions($name)
11698
}
11799

118100
/**
119-
* Returns the type guesser provided by this extension.
120-
*
121-
* @return FormTypeGuesserInterface|null The type guesser
101+
* {@inheritdoc}
122102
*/
123103
public function getTypeGuesser()
124104
{

src/Symfony/Component/Form/AbstractType.php

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -22,111 +22,60 @@ abstract class AbstractType implements FormTypeInterface
2222
private $extensions = array();
2323

2424
/**
25-
* Builds the form.
26-
*
27-
* This method gets called for each type in the hierarchy starting from the
28-
* top most type.
29-
* Type extensions can further modify the form.
30-
*
31-
* @see FormTypeExtensionInterface::buildForm()
32-
*
33-
* @param FormBuilder $builder The form builder
34-
* @param array $options The options
25+
* {@inheritdoc}
3526
*/
3627
public function buildForm(FormBuilder $builder, array $options)
3728
{
3829
}
3930

4031
/**
41-
* Builds the form view.
42-
*
43-
* This method gets called for each type in the hierarchy starting from the
44-
* top most type.
45-
* Type extensions can further modify the view.
46-
*
47-
* @see FormTypeExtensionInterface::buildView()
48-
*
49-
* @param FormView $view The view
50-
* @param FormInterface $form The form
32+
* {@inheritdoc}
5133
*/
5234
public function buildView(FormView $view, FormInterface $form)
5335
{
5436
}
5537

5638
/**
57-
* Builds the form view.
58-
*
59-
* This method gets called for each type in the hierarchy starting from the
60-
* top most type.
61-
* Type extensions can further modify the view.
62-
*
63-
* Children views have been built while this method gets called so you get
64-
* a chance to modify them.
65-
*
66-
* @see FormTypeExtensionInterface::buildViewBottomUp()
67-
*
68-
* @param FormView $view The view
69-
* @param FormInterface $form The form
39+
* {@inheritdoc}
7040
*/
7141
public function buildViewBottomUp(FormView $view, FormInterface $form)
7242
{
7343
}
7444

7545
/**
76-
* Returns a builder for the current type.
77-
*
78-
* The builder is retrieved by going up in the type hierarchy when a type does
79-
* not provide one.
80-
*
81-
* @param string $name The name of the builder
82-
* @param FormFactoryInterface $factory The form factory
83-
* @param array $options The options
84-
*
85-
* @return FormBuilder|null A form builder or null when the type does not have a builder
46+
* {@inheritdoc}
8647
*/
8748
public function createBuilder($name, FormFactoryInterface $factory, array $options)
8849
{
8950
return null;
9051
}
9152

9253
/**
93-
* Returns the default options for this type.
94-
*
95-
* @return array The default options
54+
* {@inheritdoc}
9655
*/
9756
public function getDefaultOptions()
9857
{
9958
return array();
10059
}
10160

10261
/**
103-
* Returns the allowed option values for each option (if any).
104-
*
105-
* @return array The allowed option values
62+
* {@inheritdoc}
10663
*/
10764
public function getAllowedOptionValues()
10865
{
10966
return array();
11067
}
11168

11269
/**
113-
* Returns the name of the parent type.
114-
*
115-
* @param array $options
116-
*
117-
* @return string|null The name of the parent type if any otherwise null
70+
* {@inheritdoc}
11871
*/
11972
public function getParent(array $options)
12073
{
12174
return 'form';
12275
}
12376

12477
/**
125-
* Adds extensions for this type.
126-
*
127-
* @param array $extensions An array of FormTypeExtensionInterface
128-
*
129-
* @throws UnexpectedTypeException if any extension does not implement FormTypeExtensionInterface
78+
* {@inheritdoc}
13079
*/
13180
public function setExtensions(array $extensions)
13281
{
@@ -140,9 +89,7 @@ public function setExtensions(array $extensions)
14089
}
14190

14291
/**
143-
* Returns the extensions associated with this type.
144-
*
145-
* @return array An array of FormTypeExtensionInterface
92+
* {@inheritdoc}
14693
*/
14794
public function getExtensions()
14895
{

src/Symfony/Component/Form/AbstractTypeExtension.php

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,64 +14,36 @@
1414
abstract class AbstractTypeExtension implements FormTypeExtensionInterface
1515
{
1616
/**
17-
* Builds the form.
18-
*
19-
* This method gets called after the extended type has built the form to
20-
* further modify it.
21-
*
22-
* @see FormTypeInterface::buildForm()
23-
*
24-
* @param FormBuilder $builder The form builder
25-
* @param array $options The options
17+
* {@inheritdoc}
2618
*/
2719
public function buildForm(FormBuilder $builder, array $options)
2820
{
2921
}
3022

3123
/**
32-
* Builds the view.
33-
*
34-
* This method gets called after the extended type has built the view to
35-
* further modify it.
36-
*
37-
* @see FormTypeInterface::buildView()
38-
*
39-
* @param FormView $view The view
40-
* @param FormInterface $form The form
24+
* {@inheritdoc}
4125
*/
4226
public function buildView(FormView $view, FormInterface $form)
4327
{
4428
}
4529

4630
/**
47-
* Builds the view.
48-
*
49-
* This method gets called after the extended type has built the view to
50-
* further modify it.
51-
*
52-
* @see FormTypeInterface::buildViewBottomUp()
53-
*
54-
* @param FormView $view The view
55-
* @param FormInterface $form The form
31+
* {@inheritdoc}
5632
*/
5733
public function buildViewBottomUp(FormView $view, FormInterface $form)
5834
{
5935
}
6036

6137
/**
62-
* Overrides the default options form the extended type.
63-
*
64-
* @return array
38+
* {@inheritdoc}
6539
*/
6640
public function getDefaultOptions()
6741
{
6842
return array();
6943
}
7044

7145
/**
72-
* Returns the allowed option values for each option (if any).
73-
*
74-
* @return array The allowed option values
46+
* {@inheritdoc}
7547
*/
7648
public function getAllowedOptionValues()
7749
{

src/Symfony/Component/Form/DataMapperInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
interface DataMapperInterface
1515
{
16+
/**
17+
* @param dataClass $data
18+
* @param array $forms
19+
*
20+
* @throws Exception\UnexpectedTypeException if the type of the data parameter is not supported
21+
*/
1622
function mapDataToForms($data, array $forms);
1723

1824
function mapDataToForm($data, FormInterface $form);

src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ public function __construct($dataClass = null)
3131
}
3232

3333
/**
34-
* @param dataClass $data
35-
* @param array $forms
36-
*
37-
* @throws UnexpectedTypeException if the type of the data parameter is not supported
34+
* {@inheritdoc}
3835
*/
3936
public function mapDataToForms($data, array $forms)
4037
{
@@ -56,6 +53,9 @@ public function mapDataToForms($data, array $forms)
5653
}
5754
}
5855

56+
/**
57+
* {@inheritdoc}
58+
*/
5959
public function mapDataToForm($data, FormInterface $form)
6060
{
6161
if (!empty($data)) {
@@ -73,6 +73,9 @@ public function mapDataToForm($data, FormInterface $form)
7373
}
7474
}
7575

76+
/**
77+
* {@inheritdoc}
78+
*/
7679
public function mapFormsToData(array $forms, &$data)
7780
{
7881
$iterator = new VirtualFormAwareIterator($forms);
@@ -83,6 +86,9 @@ public function mapFormsToData(array $forms, &$data)
8386
}
8487
}
8588

89+
/**
90+
* {@inheritdoc}
91+
*/
8692
public function mapFormToData(FormInterface $form, &$data)
8793
{
8894
$propertyPath = $form->getAttribute('property_path');

src/Symfony/Component/Form/Extension/Csrf/CsrfExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\Form\AbstractExtension;
1717

1818
/**
19-
* This extension protects forms by using a CSRF token
19+
* This extension protects forms by using a CSRF token.
2020
*/
2121
class CsrfExtension extends AbstractExtension
2222
{

src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider;
1313

1414
/**
15-
* Default implementation of CsrfProviderInterface
15+
* Default implementation of CsrfProviderInterface.
1616
*
1717
* This provider uses the session ID returned by session_id() as well as a
1818
* user-defined secret value to secure the CSRF token.
@@ -57,11 +57,11 @@ public function isCsrfTokenValid($intention, $token)
5757
}
5858

5959
/**
60-
* Returns the ID of the user session
60+
* Returns the ID of the user session.
6161
*
6262
* Automatically starts the session if necessary.
6363
*
64-
* @return string The session ID
64+
* @return string The session ID
6565
*/
6666
protected function getSessionId()
6767
{

src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
/**
1717
* This provider uses a Symfony2 Session object to retrieve the user's
18-
* session ID
18+
* session ID.
1919
*
20-
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
20+
* @see DefaultCsrfProvider
2121
*
22-
* @see DefaultCsrfProvider
22+
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
2323
*/
2424
class SessionCsrfProvider extends DefaultCsrfProvider
2525
{
@@ -30,7 +30,7 @@ class SessionCsrfProvider extends DefaultCsrfProvider
3030
protected $session;
3131

3232
/**
33-
* Initializes the provider with a Session object and a secret value
33+
* Initializes the provider with a Session object and a secret value.
3434
*
3535
* A recommended value for the secret is a generated value with at least
3636
* 32 characters and mixed letters, digits and special characters.
@@ -46,11 +46,7 @@ public function __construct(Session $session, $secret)
4646
}
4747

4848
/**
49-
* Returns the ID of the user session
50-
*
51-
* Automatically starts the session if necessary.
52-
*
53-
* @return string The session ID
49+
* {@inheritdoc}
5450
*/
5551
protected function getSessionId()
5652
{

src/Symfony/Component/Form/FormExtensionInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ interface FormExtensionInterface
2222
* @param string $name The name of the type
2323
*
2424
* @return FormTypeInterface The type
25+
*
26+
* @throws Exception\FormException if the given type is not supported by this extension
2527
*/
2628
function getType($name);
2729

0 commit comments

Comments
 (0)
0