8000 Remove a hack · FriendsOfSymfony/FOSRestBundle@7bcd70b · GitHub
[go: up one dir, main page]

Sk 8000 ip to content

Commit 7bcd70b

Browse files
committed
Remove a hack
1 parent 563efd1 commit 7bcd70b

File tree

4 files changed

+1
-50
lines changed

4 files changed

+1
-50
lines changed

Serializer/Normalizer/FormErrorNormalizer.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace FOS\RestBundle\Serializer\Normalizer;
1313

14-
use FOS\RestBundle\Util\FormWrapper;
1514
use Symfony\Component\Form\FormError;
1615
use Symfony\Component\Form\FormInterface;
1716
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
@@ -36,10 +35,6 @@ public function __construct(TranslatorInterface $translator)
3635
*/
3736
public function normalize($object, $format = null, array $context = [])
3837
{
39-
if ($object instanceof FormWrapper) {
40-
$object = $object->form;
41-
}
42-
4338
return [
4439
'code' => isset($context['status_code']) ? $context['status_code'] : null,
4540
'message' => 'Validation Failed',
@@ -52,10 +47,6 @@ public function normalize($object, $format = null, array $context = [])
5247
*/
5348
public function supportsNormalization($data, $format = null)
5449
{
55-
if ($data instanceof FormWrapper) {
56-
$data = $data->form;
57-
}
58-
5950
return $data instanceof FormInterface && $data->isSubmitted() && !$data->isValid();
6051
}
6152

Serializer/SymfonySerializerAdapter.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace FOS\RestBundle\Serializer;
1313

1414
use FOS\RestBundle\Context\Context;
15-
use FOS\RestBundle\Util\FormWrapper;
16-
use Symfony\Component\Form\FormInterface;
1715
use Symfony\Component\Serializer\SerializerInterface;
1816

1917
/**
@@ -35,14 +33,6 @@ public function __construct(SerializerInterface $serializer)
3533
*/
3634
public function serialize($data, $format, Context $context)
3735
{
38-
/*
39-
* Bug fix, see https://github.com/symfony/symfony/pull/17984
40-
* will be removed in the future.
41-
*/
42-
if ($data instanceof FormInterface && $format === 'xml') {
43-
$data = new FormWrapper($data);
44-
}
45-
4636
$newContext = $this->convertContext($context);
4737
$newContext['serializeNull'] = $context->getSerializeNull();
4838

Util/FormWrapper.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"symfony/phpunit-bridge": "~2.7|^3.0",
3737
"symfony/form": "^2.7|^3.0",
3838
"symfony/validator": "^2.7|^3.0",
39-
"symfony/serializer": "^2.7|^3.0",
39+
"symfony/serializer": "^2.7.11|^3.0.4",
4040
"symfony/yaml": "^2.7|^3.0",
4141
"symfony/security-bundle": "^2.7|^3.0",
4242
"symfony/web-profiler-bundle": "^2.7|^3.0",

0 commit comments

Comments
 (0)
0