Skip to content

Commit 3697adf

Browse files
committed
stop marking parameters implicitly as nullable
1 parent 8b83945 commit 3697adf

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Tests/Fixtures/FooInterfaceDummyDenormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
final class FooInterfaceDummyDenormalizer implements DenormalizerInterface
1717
{
18-
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): array
18+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): array
1919
{
2020
$result = [];
2121
foreach ($data as $foo) {
@@ -27,7 +27,7 @@ public function denormalize(mixed $data, string $type, string $format = null, ar
2727
return $result;
2828
}
2929

30-
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
30+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
3131
{
3232
if (str_ends_with($type, '[]')) {
3333
$className = substr($type, 0, -2);

Tests/Fixtures/FormatAndContextAwareNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class FormatAndContextAwareNormalizer extends ObjectNormalizer
1717
{
18-
protected function isAllowedAttribute($classOrObject, string $attribute, string $format = null, array $context = []): bool
18+
protected function isAllowedAttribute($classOrObject, string $attribute, ?string $format = null, array $context = []): bool
1919
{
2020
return \in_array($attribute, ['foo', 'bar']) && 'foo_and_bar_included' === $format;
2121
}

Tests/Fixtures/StaticConstructorNormalizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ public function getSupportedTypes(?string $format): array
2323
return [StaticConstructorDummy::class];
2424
}
2525

26-
protected function extractAttributes(object $object, string $format = null, array $context = []): array
26+
protected function extractAttributes(object $object, ?string $format = null, array $context = []): array
2727
{
2828
return get_object_vars($object);
2929
}
3030

31-
protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = []): mixed
31+
protected function getAttributeValue(object $object, string $attribute, ?string $format = null, array $context = []): mixed
3232
{
3333
return $object->$attribute;
3434
}
3535

36-
protected function setAttributeValue(object $object, string $attribute, mixed $value, string $format = null, array $context = []): void
36+
protected function setAttributeValue(object $object, string $attribute, mixed $value, ?string $format = null, array $context = []): void
3737
{
3838
$object->$attribute = $value;
3939
}

0 commit comments

Comments
 (0)