Skip to content

Commit

Permalink
Refactor supportsDenormalization function format
Browse files Browse the repository at this point in the history
The supportsDenormalization function in both JWESerializer.php and JWSSerializer.php files were refactored. This was primarily for improved readability, with arguments now listed out on separate lines.
  • Loading branch information
Spomky committed Apr 17, 2024
1 parent ba07e0f commit 0b8be70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/Bundle/Serializer/JWESerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ public function getSupportedTypes(?string $format): array
];
}

public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
public function supportsDenormalization(
mixed $data,
string $type,
?string $format = null,
array $context = []
): bool {
return $type === JWE::class
&& class_exists(JWESerializerManager::class)
&& $this->formatSupported($format);
Expand Down
8 changes: 6 additions & 2 deletions src/Bundle/Serializer/JWSSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ public function getSupportedTypes(?string $format): array
];
}

public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
public function supportsDenormalization(
mixed $data,
string $type,
?string $format = null,
array $context = []
): bool {
return $type === JWS::class
&& class_exists(JWSSerializerManager::class)
&& $this->formatSupported($format);
Expand Down

0 comments on commit 0b8be70

Please sign in to comment.