Skip to content

Commit 52fc706

Browse files
committed
minor #13837 Add compatible type-hinting (Dispositif)
This PR was submitted for the 5.1 branch but it was merged into the 5.0 branch instead. Discussion ---------- Add compatible type-hinting Declaration must be compatible with NormalizerInterface Commits ------- e21f236 Add compatible type-hinting
2 parents 669b4f2 + e21f236 commit 52fc706

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

serializer/custom_normalizer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:
3535
$this->normalizer = $normalizer;
3636
}
3737

38-
public function normalize($topic, $format = null, array $context = [])
38+
public function normalize($topic, string $format = null, array $context = [])
3939
{
4040
$data = $this->normalizer->normalize($topic, $format, $context);
4141

@@ -47,7 +47,7 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:
4747
return $data;
4848
}
4949

50-
public function supportsNormalization($data, $format = null, array $context = [])
50+
public function supportsNormalization($data, string $format = null, array $context = [])
5151
{
5252
return $data instanceof Topic;
5353
}

0 commit comments

Comments
 (0)