[Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
This commit is contained in:
parent
d671406ae5
commit
6cbc862e19
@ -151,11 +151,8 @@
|
|||||||
</service>
|
</service>
|
||||||
|
|
||||||
<!-- FormTypeHttpFoundationExtension -->
|
<!-- FormTypeHttpFoundationExtension -->
|
||||||
<service id="form.server_params" class="Symfony\Component\Form\Util\ServerParams" public="false"/>
|
|
||||||
|
|
||||||
<service id="form.type_extension.form.http_foundation" class="Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension">
|
<service id="form.type_extension.form.http_foundation" class="Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension">
|
||||||
<tag name="form.type_extension" alias="form" />
|
<tag name="form.type_extension" alias="form" />
|
||||||
<argument type="service" id="form.server_params"/>
|
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<!-- FormTypeValidatorExtension -->
|
<!-- FormTypeValidatorExtension -->
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace Symfony\Component\Form\Extension\HttpFoundation;
|
namespace Symfony\Component\Form\Extension\HttpFoundation;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractExtension;
|
use Symfony\Component\Form\AbstractExtension;
|
||||||
use Symfony\Component\Form\Util\ServerParams;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Integrates the HttpFoundation component with the Form library.
|
* Integrates the HttpFoundation component with the Form library.
|
||||||
@ -21,20 +20,10 @@ use Symfony\Component\Form\Util\ServerParams;
|
|||||||
*/
|
*/
|
||||||
class HttpFoundationExtension extends AbstractExtension
|
class HttpFoundationExtension extends AbstractExtension
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @var ServerParams
|
|
||||||
*/
|
|
||||||
private $serverParams;
|
|
||||||
|
|
||||||
public function __construct(ServerParams $serverParams = null)
|
|
||||||
{
|
|
||||||
$this->serverParams = $serverParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function loadTypeExtensions()
|
protected function loadTypeExtensions()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new Type\FormTypeHttpFoundationExtension($this->serverParams),
|
new Type\FormTypeHttpFoundationExtension(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ use Symfony\Component\Form\AbstractTypeExtension;
|
|||||||
use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
|
use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
|
||||||
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
|
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Form\Util\ServerParams;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||||
@ -32,10 +31,10 @@ class FormTypeHttpFoundationExtension extends AbstractTypeExtension
|
|||||||
*/
|
*/
|
||||||
private $requestHandler;
|
private $requestHandler;
|
||||||
|
|
||||||
public function __construct(ServerParams $serverParams = null)
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->listener = new BindRequestListener();
|
$this->listener = new BindRequestListener();
|
||||||
$this->requestHandler = new HttpFoundationRequestHandler($serverParams);
|
$this->requestHandler = new HttpFoundationRequestHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user