minor #21233 [Form] Removed unused ResolvedTypeFactory in FormFactory constructor (HeahDude)
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Form] Removed unused ResolvedTypeFactory in FormFactory constructor
| Q | A
| ------------- | ---
| Branch? | 3.1
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | ~
| License | MIT
| Doc PR | ~
____
This PR just removes some legacy code from 2.x.
Commits
-------
3607eb3dd0
[Form] Removed unused ResolvedTypeFactory in FormFactory constructor
This commit is contained in:
commit
cbecfc3d74
@ -15,20 +15,11 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||
|
||||
class FormFactory implements FormFactoryInterface
|
||||
{
|
||||
/**
|
||||
* @var FormRegistryInterface
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* @var ResolvedFormTypeFactoryInterface
|
||||
*/
|
||||
private $resolvedTypeFactory;
|
||||
|
||||
public function __construct(FormRegistryInterface $registry, ResolvedFormTypeFactoryInterface $resolvedTypeFactory)
|
||||
public function __construct(FormRegistryInterface $registry)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->resolvedTypeFactory = $resolvedTypeFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,9 +154,8 @@ class FormFactoryBuilder implements FormFactoryBuilderInterface
|
||||
$extensions[] = new PreloadedExtension($this->types, $this->typeExtensions, $typeGuesser);
|
||||
}
|
||||
|
||||
$resolvedTypeFactory = $this->resolvedTypeFactory ?: new ResolvedFormTypeFactory();
|
||||
$registry = new FormRegistry($extensions, $resolvedTypeFactory);
|
||||
$registry = new FormRegistry($extensions, $this->resolvedTypeFactory ?: new ResolvedFormTypeFactory());
|
||||
|
||||
return new FormFactory($registry, $resolvedTypeFactory);
|
||||
return new FormFactory($registry);
|
||||
}
|
||||
}
|
||||
|
@ -37,11 +37,6 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* @var \PHPUnit_Framework_MockObject_MockObject
|
||||
*/
|
||||
private $resolvedTypeFactory;
|
||||
|
||||
/**
|
||||
* @var \PHPUnit_Framework_MockObject_MockObject
|
||||
*/
|
||||
@ -54,12 +49,11 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->resolvedTypeFactory = $this->getMockBuilder('Symfony\Component\Form\ResolvedFormTypeFactoryInterface')->getMock();
|
||||
$this->guesser1 = $this->getMockBuilder('Symfony\Component\Form\FormTypeGuesserInterface')->getMock();
|
||||
$this->guesser2 = $this->getMockBuilder('Symfony\Component\Form\FormTypeGuesserInterface')->getMock();
|
||||
$this->registry = $this->getMockBuilder('Symfony\Component\Form\FormRegistryInterface')->getMock();
|
||||
$this->builder = $this->getMockBuilder('Symfony\Component\Form\Test\FormBuilderInterface')->getMock();
|
||||
$this->factory = new FormFactory($this->registry, $this->resolvedTypeFactory);
|
||||
$this->factory = new FormFactory($this->registry);
|
||||
|
||||
$this->registry->expects($this->any())
|
||||
->method('getTypeGuesser')
|
||||
@ -244,7 +238,7 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
$registry = $this->getMockBuilder('Symfony\Component\Form\FormRegistryInterface')->getMock();
|
||||
$factory = $this->getMockBuilder('Symfony\Component\Form\FormFactory')
|
||||
->setMethods(array('createNamedBuilder'))
|
||||
->setConstructorArgs(array($registry, $this->resolvedTypeFactory))
|
||||
->setConstructorArgs(array($registry))
|
||||
->getMock();
|
||||
|
||||
$factory->expects($this->once())
|
||||
@ -474,7 +468,7 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
return $this->getMockBuilder('Symfony\Component\Form\FormFactory')
|
||||
->setMethods($methods)
|
||||
->setConstructorArgs(array($this->registry, $this->resolvedTypeFactory))
|
||||
->setConstructorArgs(array($this->registry))
|
||||
->getMock();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user