Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

Sign up
Appearance settings

Commitae7c378

Browse files
committed
[Form] Renamed form processors to request handlers
1 parent51a3561 commitae7c378

19 files changed

+102
-98
lines changed

‎UPGRADE-3.0.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ UPGRADE FROM 2.x to 3.0
2222

2323
* Passing a`Symfony\Component\HttpFoundation\Request` instance to
2424
`FormInterface::bind()` was disabled. You should use
25-
`FormInterface::process()` instead.
25+
`FormInterface::handleRequest()` instead.
2626

2727
Before:
2828

@@ -39,7 +39,9 @@ UPGRADE FROM 2.x to 3.0
3939
After:
4040

4141
```
42-
if ($form->process($request)->isValid()) {
42+
$form->handleRequest();
43+
44+
if ($form->isValid()) {
4345
// ...
4446
}
4547
```
@@ -48,7 +50,9 @@ UPGRADE FROM 2.x to 3.0
4850
the method`isBound()`:
4951

5052
```
51-
if ($form->process($request)->isBound()) {
53+
$form->handleRequest();
54+
55+
if ($form->isBound()) {
5256
// ...
5357
5458
if ($form->isValid()) {

‎src/Symfony/Component/Form/Button.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public function isSynchronized()
350350
*
351351
* @throws BadMethodCallException
352352
*/
353-
publicfunctionprocess($request =null)
353+
publicfunctionhandleRequest($request =null)
354354
{
355355
thrownewBadMethodCallException('Buttons cannot be processed. Call process() on the root form instead.');
356356
}

‎src/Symfony/Component/Form/ButtonBuilder.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,11 @@ public function setMethod($method)
483483
/**
484484
* Unsupported method.
485485
*
486-
* @paramFormProcessorInterface $formProcessor
486+
* @paramRequestHandlerInterface $requestHandler
487487
*
488488
* @throws BadMethodCallException
489489
*/
490-
publicfunctionsetFormProcessor(FormProcessorInterface$formProcessor)
490+
publicfunctionsetRequestHandler(RequestHandlerInterface$requestHandler)
491491
{
492492
thrownewBadMethodCallException('Buttons do not support form processors.');
493493
}
@@ -766,7 +766,7 @@ public function getMethod()
766766
*
767767
* @return null Always returns null.
768768
*/
769-
publicfunctiongetFormProcessor()
769+
publicfunctiongetRequestHandler()
770770
{
771771
returnnull;
772772
}

‎src/Symfony/Component/Form/CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CHANGELOG
88
* deprecated FormPerformanceTestCase and FormIntegrationTestCase in the Symfony\Component\Form\Tests namespace and moved them to the Symfony\Component\Form\Test namespace
99
* deprecated TypeTestCase in the Symfony\Component\Form\Tests\Extension\Core\Type namespace and moved it to the Symfony\Component\Form\Test namespace
1010
* changed FormRenderer::humanize() to humanize also camel cased field name
11-
* addedFormProcessorInterface and FormInterface::process()
11+
* addedRequestHandlerInterface and FormInterface::handleRequest()
1212
* deprecated passing a Request instance to FormInterface::bind()
1313
* added options "method" and "action" to FormType
1414
* deprecated option "virtual" in favor "inherit_data"

‎src/Symfony/Component/Form/Extension/HttpFoundation/RequestFormProcessor.php‎renamed to ‎src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
useSymfony\Component\Form\Exception\InvalidArgumentException;
1515
useSymfony\Component\Form\Exception\UnexpectedTypeException;
1616
useSymfony\Component\Form\FormInterface;
17-
useSymfony\Component\Form\FormProcessorInterface;
17+
useSymfony\Component\Form\RequestHandlerInterface;
1818
useSymfony\Component\HttpFoundation\Request;
1919

2020
/**
21-
* Aform processor using the {@link Request} class of the HttpFoundation
21+
* Arequest processor using the {@link Request} class of the HttpFoundation
2222
* component.
2323
*
2424
* @author Bernhard Schussek <bschussek@gmail.com>
2525
*/
26-
classRequestFormProcessorimplementsFormProcessorInterface
26+
classHttpFoundationRequestHandlerimplementsRequestHandlerInterface
2727
{
2828
/**
2929
* {@inheritdoc}
3030
*/
31-
publicfunctionprocessForm(FormInterface$form,$request =null)
31+
publicfunctionhandleRequest(FormInterface$form,$request =null)
3232
{
3333
if (!$requestinstanceof Request) {
3434
thrownewUnexpectedTypeException($request,'Symfony\Component\HttpFoundation\Request');

‎src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
useSymfony\Component\Form\AbstractTypeExtension;
1515
useSymfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
16-
useSymfony\Component\Form\Extension\HttpFoundation\RequestFormProcessor;
16+
useSymfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler;
1717
useSymfony\Component\Form\FormBuilderInterface;
1818

1919
/**
@@ -27,14 +27,14 @@ class FormTypeHttpFoundationExtension extends AbstractTypeExtension
2727
private$listener;
2828

2929
/**
30-
* @varRequestFormProcessor
30+
* @varHttpFoundationRequestHandler
3131
*/
32-
private$processor;
32+
private$requestHandler;
3333

3434
publicfunction__construct()
3535
{
3636
$this->listener =newBindRequestListener();
37-
$this->processor =newRequestFormProcessor();
37+
$this->requestHandler =newHttpFoundationRequestHandler();
3838
}
3939

4040
/**
@@ -43,7 +43,7 @@ public function __construct()
4343
publicfunctionbuildForm(FormBuilderInterface$builder,array$options)
4444
{
4545
$builder->addEventSubscriber($this->listener);
46-
$builder->setFormProcessor($this->processor);
46+
$builder->setRequestHandler($this->requestHandler);
4747
}
4848

4949
/**

‎src/Symfony/Component/Form/Form.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ public function getExtraData()
454454
/**
455455
* {@inheritdoc}
456456
*/
457-
publicfunctionprocess($request =null)
457+
publicfunctionhandleRequest($request =null)
458458
{
459-
$this->config->getFormProcessor()->processForm($this,$request);
459+
$this->config->getRequestHandler()->handleRequest($this,$request);
460460

461461
return$this;
462462
}

‎src/Symfony/Component/Form/FormConfigBuilder.php‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
class FormConfigBuilderimplements FormConfigBuilderInterface
2929
{
3030
/**
31-
* Caches a globally unique {@linkNativeFormProcessor} instance.
31+
* Caches a globally unique {@linkNativeRequestHandler} instance.
3232
*
33-
* @varNativeFormProcessor
33+
* @varNativeRequestHandler
3434
*/
35-
privatestatic$nativeFormProcessor;
35+
privatestatic$nativeRequestProcessor;
3636

3737
/**
3838
* The accepted request methods.
@@ -168,9 +168,9 @@ class FormConfigBuilder implements FormConfigBuilderInterface
168168
private$method ='POST';
169169

170170
/**
171-
* @varFormProcessorInterface
171+
* @varRequestHandlerInterface
172172
*/
173-
private$formProcessor;
173+
private$requestHandler;
174174

175175
/**
176176
* @var array
@@ -509,16 +509,16 @@ public function getMethod()
509509
/**
510510
* {@inheritdoc}
511511
*/
512-
publicfunctiongetFormProcessor()
512+
publicfunctiongetRequestHandler()
513513
{
514-
if (null ===$this->formProcessor) {
515-
if (null ===self::$nativeFormProcessor) {
516-
self::$nativeFormProcessor =newNativeFormProcessor();
514+
if (null ===$this->requestHandler) {
515+
if (null ===self::$nativeRequestProcessor) {
516+
self::$nativeRequestProcessor =newNativeRequestHandler();
517517
}
518-
$this->formProcessor =self::$nativeFormProcessor;
518+
$this->requestHandler =self::$nativeRequestProcessor;
519519
}
520520

521-
return$this->formProcessor;
521+
return$this->requestHandler;
522522
}
523523

524524
/**
@@ -832,13 +832,13 @@ public function setMethod($method)
832832
/**
833833
* {@inheritdoc}
834834
*/
835-
publicfunctionsetFormProcessor(FormProcessorInterface$formProcessor)
835+
publicfunctionsetRequestHandler(RequestHandlerInterface$requestHandler)
836836
{
837837
if ($this->locked) {
838838
thrownewBadMethodCallException('The config builder cannot be modified anymore.');
839839
}
840840

841-
$this->formProcessor =$formProcessor;
841+
$this->requestHandler =$requestHandler;
842842

843843
return$this;
844844
}

‎src/Symfony/Component/Form/FormConfigBuilderInterface.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ public function setAction($action);
256256
publicfunctionsetMethod($method);
257257

258258
/**
259-
* @paramFormProcessorInterface $formProcessor
259+
* @paramRequestHandlerInterface $requestHandler
260260
*
261261
* @return self The configuration object.
262262
*/
263-
publicfunctionsetFormProcessor(FormProcessorInterface$formProcessor);
263+
publicfunctionsetRequestHandler(RequestHandlerInterface$requestHandler);
264264

265265
/**
266266
* Builds and returns the form configuration.

‎src/Symfony/Component/Form/FormConfigInterface.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ public function getAction();
201201
publicfunctiongetMethod();
202202

203203
/**
204-
* @returnFormProcessorInterface The form processor.
204+
* @returnRequestHandlerInterface The form processor.
205205
*/
206-
publicfunctiongetFormProcessor();
206+
publicfunctiongetRequestHandler();
207207

208208
/**
209209
* Returns all options passed during the construction of the form.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp