8000 [Form] remove restriction on allowed http methods · symfony/symfony@27d228c · GitHub
[go: up one dir, main page]

Skip to content

Commit 27d228c

Browse files
committed
[Form] remove restriction on allowed http methods
1 parent eb59771 commit 27d228c

File tree

4 files changed

+2
-29
lines changed

4 files changed

+2
-29
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<!-- FormFactory -->
3030
<service id="form.factory" class="Symfony\Component\Form\FormFactory" public="true">
3131
<argument type="service" id="form.registry" />
32-
<argument type="service" id="form.resolved_type_factory" />
3332
</service>
3433
<service id="Symfony\Component\Form\FormFactoryInterface" alias="form.factory" />
3534

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* deprecated calling `FormRenderer::searchAndRenderBlock` for fields which were already rendered
1010
* added a cause when a CSRF error has occurred
1111
* deprecated the `scale` option of the `IntegerType`
12+
* removed restriction on allowed HTTP methods
1213

1314
4.1.0
1415
-----

src/Symfony/Component/Form/FormConfigBuilder.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@ class FormConfigBuilder implements FormConfigBuilderInterface
3434
*/
3535
private static $nativeRequestHandler;
3636

37-
/**
38-
* The accepted request methods.
39-
*
40-
* @var array
41-
*/
42-
private static $allowedMethods = array(
43-
'GET',
44-
'PUT',
45-
'POST',
46-
'DELETE',
47-
'PATCH',
48-
);
49-
5037
/**
5138
* @var bool
5239
*/
@@ -788,13 +775,7 @@ public function setMethod($method)
788775
throw new BadMethodCallException('The config builder cannot be modified anymore.');
789776
}
790777

791-
$upperCaseMethod = strtoupper($method);
792-
793-
if (!\in_array($upperCaseMethod, self::$allowedMethods)) {
794-
throw new InvalidArgumentException(sprintf('The form method is "%s", but should be one of "%s".', $method, implode('", "', self::$allowedMethods)));
795-
}
796-
797-
$this->method = $upperCaseMethod;
778+
$this->method = strtoupper($method);
798779

799780
return $this;
800781
}

src/Symfony/Component/Form/Tests/FormConfigTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,6 @@ public function testSetMethodAllowsPatch()
138138
self::assertSame('PATCH', $formConfigBuilder->getMethod());
139139
}
140140

141-
/**
142-
* @expectedException \Symfony\Component\Form\Exception\InvalidArgumentException
143-
*/
144-
public function testSetMethodDoesNotAllowOtherValues()
145-
{
146-
$this->getConfigBuilder()->setMethod('foo');
147-
}
148-
149141
private function getConfigBuilder($name = 'name')
150142
{
151143
$dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();

0 commit comments

Comments
 (0)
0