Skip to content

Commit b98631a

Browse files
[Serializer] Add missing types to BackedEnumNormalizer
1 parent fe3bd9e commit b98631a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Normalizer/BackedEnumNormalizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class BackedEnumNormalizer implements NormalizerInterface, DenormalizerInt
2929
*
3030
* @return int|string
3131
*/
32-
public function normalize($object, $format = null, array $context = [])
32+
public function normalize($object, string $format = null, array $context = [])
3333
{
3434
if (!$object instanceof \BackedEnum) {
3535
throw new InvalidArgumentException('The data must belong to a backed enumeration.');
@@ -41,7 +41,7 @@ public function normalize($object, $format = null, array $context = [])
4141
/**
4242
* {@inheritdoc}
4343
*/
44-
public function supportsNormalization($data, $format = null): bool
44+
public function supportsNormalization($data, string $format = null): bool
4545
{
4646
return $data instanceof \BackedEnum;
4747
}
@@ -51,7 +51,7 @@ public function supportsNormalization($data, $format = null): bool
5151
*
5252
* @throws NotNormalizableValueException
5353
*/
54-
public function denormalize($data, $type, $format = null, array $context = [])
54+
public function denormalize($data, string $type, string $format = null, array $context = [])
5555
{
5656
if (!is_subclass_of($type, \BackedEnum::class)) {
5757
throw new InvalidArgumentException('The data must belong to a backed enumeration.');
@@ -71,7 +71,7 @@ public function denormalize($data, $type, $format = null, array $context = [])
7171
/**
7272
* {@inheritdoc}
7373
*/
74-
public function supportsDenormalization($data, $type, $format = null): bool
74+
public function supportsDenormalization($data, string $type, string $format = null): bool
7575
{
7676
return is_subclass_of($type, \BackedEnum::class);
7777
}

0 commit comments

Comments
 (0)