Skip to content

Commit 5c1ff96

Browse files
committed
chore(deprecation): symfony normalizer/encoder context
1 parent 1c22b8e commit 5c1ff96

24 files changed

+31
-153
lines changed

src/Core/Bridge/Symfony/Bundle/Command/SwaggerCommand.php

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

src/Elasticsearch/Serializer/DocumentNormalizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function __construct(ResourceMetadataCollectionFactoryInterface $resource
4545
/**
4646
* {@inheritdoc}
4747
*/
48-
public function supportsDenormalization($data, $type, $format = null): bool
48+
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
4949
{
50-
return self::FORMAT === $format && parent::supportsDenormalization($data, $type, $format);
50+
return self::FORMAT === $format && parent::supportsDenormalization($data, $type, $format, $context);
5151
}
5252

5353
/**
@@ -67,7 +67,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
6767
/**
6868
* {@inheritdoc}
6969
*/
70-
public function supportsNormalization($data, $format = null): bool
70+
public function supportsNormalization($data, $format = null, array $context = []): bool
7171
{
7272
// prevent the use of lower priority normalizers (e.g. serializer.normalizer.object) for this format
7373
return self::FORMAT === $format;

src/Elasticsearch/Serializer/ItemNormalizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ public function denormalize($data, $type, $format = null, array $context = [])
7272
*
7373
* @throws LogicException
7474
*/
75-
public function supportsDenormalization($data, $type, $format = null): bool
75+
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
7676
{
7777
if (!$this->decorated instanceof DenormalizerInterface) {
7878
throw new LogicException(sprintf('The decorated normalizer must be an instance of "%s".', DenormalizerInterface::class));
7979
}
8080

81-
return DocumentNormalizer::FORMAT !== $format && $this->decorated->supportsDenormalization($data, $type, $format);
81+
return DocumentNormalizer::FORMAT !== $format && $this->decorated->supportsDenormalization($data, $type, $format, $context);
8282
}
8383

8484
/**
@@ -92,7 +92,7 @@ public function normalize($object, $format = null, array $context = []): array
9292
/**
9393
* {@inheritdoc}
9494
*/
95-
public function supportsNormalization($data, $format = null): bool
95+
public function supportsNormalization($data, $format = null, array $context = []): bool
9696
{
9797
return DocumentNormalizer::FORMAT !== $format && $this->decorated->supportsNormalization($data, $format);
9898
}

src/GraphQl/Serializer/Exception/ErrorNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function normalize($object, $format = null, array $context = []): array
3535
/**
3636
* {@inheritdoc}
3737
*/
38-
public function supportsNormalization($data, $format = null): bool
38+
public function supportsNormalization($data, $format = null, array $context = []): bool
3939
{
4040
return $data instanceof Error;
4141
}

src/GraphQl/Serializer/Exception/HttpExceptionNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function normalize($object, $format = null, array $context = []): array
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
public function supportsNormalization($data, $format = null): bool
46+
public function supportsNormalization($data, $format = null, array $context = []): bool
4747
{
4848
return $data instanceof Error && $data->getPrevious() instanceof HttpExceptionInterface;
4949
}

src/GraphQl/Serializer/Exception/RuntimeExceptionNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function normalize($object, $format = null, array $context = []): array
4040
/**
4141
* {@inheritdoc}
4242
*/
43-
public function supportsNormalization($data, $format = null): bool
43+
public function supportsNormalization($data, $format = null, array $context = []): bool
4444
{
4545
return $data instanceof Error && $data->getPrevious() instanceof \RuntimeException;
4646
}

src/GraphQl/Serializer/Exception/ValidationExceptionNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function normalize($object, $format = null, array $context = []): array
7373
/**
7474
* {@inheritdoc}
7575
*/
76-
public function supportsNormalization($data, $format = null): bool
76+
public function supportsNormalization($data, $format = null, array $context = []): bool
7777
{
7878
return $data instanceof Error && $data->getPrevious() instanceof ValidationException;
7979
}

src/Hal/Serializer/EntrypointNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function normalize($object, $format = null, array $context = []): array
7676
/**
7777
* {@inheritdoc}
7878
*/
79-
public function supportsNormalization($data, $format = null): bool
79+
public function supportsNormalization($data, $format = null, array $context = []): bool
8080
{
8181
return self::FORMAT === $format && $data instanceof Entrypoint;
8282
}

src/Hydra/Serializer/CollectionFiltersNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public function __construct(NormalizerInterface $collectionNormalizer, ResourceM
4949
/**
5050
* {@inheritdoc}
5151
*/
52-
public function supportsNormalization($data, $format = null): bool
52+
public function supportsNormalization($data, $format = null, array $context = []): bool
5353
{
54-
return $this->collectionNormalizer->supportsNormalization($data, $format);
54+
return $this->collectionNormalizer->supportsNormalization($data, $format, $context);
5555
}
5656

5757
/**

src/Hydra/Serializer/ErrorNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function normalize($object, $format = null, array $context = [])
6868
/**
6969
* {@inheritdoc}
7070
*/
71-
public function supportsNormalization($data, $format = null): bool
71+
public function supportsNormalization($data, $format = null, array $context = []): bool
7272
{
7373
return self::FORMAT === $format && ($data instanceof \Exception || $data instanceof FlattenException || $data instanceof LegacyFlattenException);
7474
}

0 commit comments

Comments
 (0)