Skip to content

Commit cd23d89

Browse files
authored
refactor(serializer): normalizers deprecations removed (Guikingone#266)
1 parent fc95c85 commit cd23d89

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

phpstan.neon.8.0.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ parameters:
1616
- '#Instantiated class Fiber not found#'
1717
- '#Call to method start\(\) on an unknown class Fiber#'
1818
- '#Call to static method suspend\(\) on an unknown class Fiber#'
19+
# The following can be dropped once Symfony 7.0+ will be required
20+
- '#Method .* has parameter \$context with no value type specified in iterable type array.#'

phpstan.neon.8.1.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ parameters:
1212
- tests
1313
excludePaths:
1414
- vendor
15+
ignoreErrors:
16+
# The following can be dropped once Symfony 7.0+ will be required
17+
- '#Method .* has parameter \$context with no value type specified in iterable type array.#'

src/Serializer/AccessLockBagNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function normalize($object, string $format = null, array $context = []):
6767
/**
6868
* {@inheritdoc}
6969
*/
70-
public function supportsNormalization($data, string $format = null): bool
70+
public function supportsNormalization($data, string $format = null, array $context = []): bool
7171
{
7272
return $data instanceof AccessLockBag;
7373
}
@@ -93,7 +93,7 @@ public function denormalize($data, string $type, string $format = null, array $c
9393
/**
9494
* {@inheritdoc}
9595
*/
96-
public function supportsDenormalization($data, string $type, string $format = null): bool
96+
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
9797
{
9898
return AccessLockBag::class === $type;
9999
}

src/Serializer/NotificationTaskBagNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function normalize($object, string $format = null, array $context = []):
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
public function supportsNormalization($data, string $format = null): bool
62+
public function supportsNormalization($data, string $format = null, array $context = []): bool
6363
{
6464
return $data instanceof NotificationTaskBag;
6565
}
@@ -86,7 +86,7 @@ public function denormalize($data, string $type, string $format = null, array $c
8686
/**
8787
* {@inheritdoc}
8888
*/
89-
public function supportsDenormalization($data, string $type, string $format = null): bool
89+
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
9090
{
9191
return NotificationTaskBag::class === $type;
9292
}

src/Serializer/SchedulerConfigurationNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function normalize($object, string $format = null, array $context = []):
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
public function supportsNormalization($data, string $format = null)
62+
public function supportsNormalization($data, string $format = null, array $context = []): bool
6363
{
6464
return $data instanceof SchedulerConfiguration;
6565
}
@@ -87,7 +87,7 @@ public function denormalize($data, string $type, string $format = null, array $c
8787
/**
8888
* {@inheritdoc}
8989
*/
90-
public function supportsDenormalization($data, string $type, string $format = null)
90+
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
9191
{
9292
return SchedulerConfiguration::class === $type;
9393
}

src/Serializer/TaskNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function normalize($object, string $format = null, array $context = []):
187187
/**
188188
* {@inheritdoc}
189189
*/
190-
public function supportsNormalization($data, string $format = null): bool
190+
public function supportsNormalization($data, string $format = null, array $context = []): bool
191191
{
192192
return $data instanceof TaskInterface;
193193
}
@@ -330,7 +330,7 @@ public function denormalize($data, string $type, string $format = null, array $c
330330
/**
331331
* {@inheritdoc}
332332
*/
333-
public function supportsDenormalization($data, string $type, string $format = null): bool
333+
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
334334
{
335335
return is_array($data) && array_key_exists(self::NORMALIZATION_DISCRIMINATOR, $data) || $type === TaskInterface::class;
336336
}

0 commit comments

Comments
 (0)