minor #29954 [Form] synchronise the form builder docblock (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] synchronise the form builder docblock

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

419d3db86c synchronise the form builder docblock
This commit is contained in:
Fabien Potencier 2019-01-23 14:02:34 +01:00
commit 0c323028d2
8 changed files with 16 additions and 33 deletions

View File

@ -45,14 +45,14 @@ class MergeDoctrineCollectionListenerTest extends TestCase
$this->form = null;
}
protected function getBuilder($name = 'name')
protected function getBuilder()
{
return new FormBuilder($name, null, $this->dispatcher, $this->factory);
return new FormBuilder('name', null, $this->dispatcher, $this->factory);
}
protected function getForm($name = 'name')
protected function getForm()
{
return $this->getBuilder($name)
return $this->getBuilder()
->setData($this->collection)
->addEventSubscriber(new MergeDoctrineCollectionListener())
->getForm();
@ -84,7 +84,7 @@ class MergeDoctrineCollectionListenerTest extends TestCase
*/
public function testLegacyChildClassOnSubmitCallParent()
{
$form = $this->getBuilder('name')
$form = $this->getBuilder()
->setData($this->collection)
->addEventSubscriber(new TestClassExtendingMergeDoctrineCollectionListener())
->getForm();

View File

@ -41,7 +41,7 @@ class FormBuilder extends FormConfigBuilder implements \IteratorAggregate, FormB
* Creates a new form builder.
*
* @param string $name
* @param string $dataClass
* @param string|null $dataClass
* @param EventDispatcherInterface $dispatcher
* @param FormFactoryInterface $factory
* @param array $options

View File

@ -205,7 +205,7 @@ class ResolvedFormType implements ResolvedFormTypeInterface
* Override this method if you want to customize the builder class.
*
* @param string $name The name of the builder
* @param string $dataClass The data class
* @param string|null $dataClass The data class
* @param FormFactoryInterface $factory The current form factory
* @param array $options The builder options
*

View File

@ -32,7 +32,7 @@ abstract class TypeTestCase extends FormIntegrationTestCase
parent::setUp();
$this->dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
$this->builder = new FormBuilder(null, null, $this->dispatcher, $this->factory);
$this->builder = new FormBuilder('', null, $this->dispatcher, $this->factory);
}
protected function tearDown()

View File

@ -55,7 +55,7 @@ abstract class AbstractFormTest extends TestCase
/**
* @param string $name
* @param EventDispatcherInterface $dispatcher
* @param string $dataClass
* @param string|null $dataClass
* @param array $options
*
* @return FormBuilder

View File

@ -41,7 +41,7 @@ class ButtonTest extends TestCase
$button->submit('');
$button->setParent($this->getFormBuilder('form')->getForm());
$button->setParent($this->getFormBuilder()->getForm());
}
/**
@ -49,7 +49,7 @@ class ButtonTest extends TestCase
*/
public function testDisabledIfParentIsDisabled($parentDisabled, $buttonDisabled, $result)
{
$form = $this->getFormBuilder('form')
$form = $this->getFormBuilder()
->setDisabled($parentDisabled)
->getForm()
;
@ -80,8 +80,8 @@ class ButtonTest extends TestCase
return new ButtonBuilder($name);
}
private function getFormBuilder($name)
private function getFormBuilder()
{
return new FormBuilder($name, null, $this->dispatcher, $this->factory);
return new FormBuilder('form', null, $this->dispatcher, $this->factory);
}
}

View File

@ -28,7 +28,7 @@ class CsrfValidationListenerTest extends TestCase
$this->dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
$this->factory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock();
$this->tokenManager = $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock();
$this->form = $this->getBuilder('post')
$this->form = $this->getBuilder()
->setDataMapper($this->getDataMapper())
->getForm();
}
@ -41,14 +41,9 @@ class CsrfValidationListenerTest extends TestCase
$this->form = null;
}
protected function getBuilder($name = 'name')
protected function getBuilder()
{
return new FormBuilder($name, null, $this->dispatcher, $this->factory, ['compound' => true]);
}
protected function getForm($name = 'name')
{
return $this->getBuilder($name)->getForm();
return new FormBuilder('post', null, $this->dispatcher, $this->factory, ['compound' => true]);
}
protected function getDataMapper()

View File

@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormTypeExtensionInterface;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\Form\ResolvedFormType;
@ -380,15 +379,4 @@ class ResolvedFormTypeTest extends TestCase
{
return $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock();
}
/**
* @param string $name
* @param array $options
*
* @return FormBuilder
*/
protected function getBuilder($name = 'name', array $options = [])
{
return new FormBuilder($name, null, $this->dispatcher, $this->factory, $options);
}
}