Skip to content

Commit 227990b

Browse files
authored
Support new symfony serializer's getSupportedTypes (#470)
1 parent 9a8f28a commit 227990b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Bundle/JoseFramework/Serializer/JWESerializer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ public function __construct(
2626
$this->serializerManager = $serializerManager;
2727
}
2828

29+
public function getSupportedTypes(?string $format): array
30+
{
31+
return [
32+
JWE::class => class_exists(JWESerializerManager::class) && $this->formatSupported($format),
33+
];
34+
}
35+
2936
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
3037
{
3138
return $type === JWE::class

src/Bundle/JoseFramework/Serializer/JWSSerializer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ public function __construct(
2626
$this->serializerManager = $serializerManager;
2727
}
2828

29+
public function getSupportedTypes(?string $format): array
30+
{
31+
return [
32+
JWS::class => class_exists(JWSSerializerManager::class) && $this->formatSupported($format),
33+
];
34+
}
35+
2936
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
3037
{
3138
return $type === JWS::class

0 commit comments

Comments
 (0)