Skip to content

Commit 3063220

Browse files
PierreRebeilleaupierre.rebeilleaudunglas
authored
fix: improve compatibility with Symfony 5.4 (api-platform#4514)
* Add return type and php docs * Fix inheritdoc missing * Update src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php Co-authored-by: Kévin Dunglas <[email protected]> Co-authored-by: pierre.rebeilleau <[email protected]> Co-authored-by: Kévin Dunglas <[email protected]>
1 parent 0d37caa commit 3063220

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ final class UuidNormalizer implements DenormalizerInterface
2828
{
2929
/**
3030
* {@inheritdoc}
31+
*
32+
* @param mixed $data
33+
* @param string $class
34+
* @param null $format
35+
*
36+
* @throws InvalidIdentifierException
37+
*
38+
* @return mixed
3139
*/
3240
public function denormalize($data, $class, $format = null, array $context = [])
3341
{
@@ -41,7 +49,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
4149
/**
4250
* {@inheritdoc}
4351
*/
44-
public function supportsDenormalization($data, $type, $format = null)
52+
public function supportsDenormalization($data, $type, $format = null): bool
4553
{
4654
return \is_string($data) && is_a($type, UuidInterface::class, true);
4755
}

src/Bridge/RamseyUuid/Serializer/UuidDenormalizer.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121

2222
final class UuidDenormalizer implements DenormalizerInterface
2323
{
24+
/**
25+
* @param mixed $data
26+
* @param string $type
27+
* @param null $format
28+
*
29+
* @return mixed
30+
*/
2431
public function denormalize($data, $type, $format = null, array $context = [])
2532
{
2633
try {
@@ -30,7 +37,7 @@ public function denormalize($data, $type, $format = null, array $context = [])
3037
}
3138
}
3239

33-
public function supportsDenormalization($data, $type, $format = null)
40+
public function supportsDenormalization($data, $type, $format = null): bool
3441
{
3542
return \is_string($data) && is_a($type, UuidInterface::class, true);
3643
}

tests/Action/EntrypointActionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class EntrypointActionTest extends TestCase
2727
{
2828
use ProphecyTrait;
2929

30-
public function testGetEntrypoint()
30+
public function testGetEntrypoint(): void
3131
{
3232
$resourceNameCollectionFactoryProphecy = $this->prophesize(ResourceNameCollectionFactoryInterface::class);
3333
$resourceNameCollectionFactoryProphecy->create()->willReturn(new ResourceNameCollection(['dummies']));

tests/Fixtures/ArrayAccessible.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public function offsetExists($offset): bool
2929
}
3030

3131
/**
32+
* @param mixed $offset
33+
*
3234
* @return mixed
3335
*/
3436
#[\ReturnTypeWillChange]

tests/Fixtures/TestBundle/Doctrine/Generator/Uuid.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public function __toString()
2727
return $this->id;
2828
}
2929

30+
/**
31+
* @return mixed
32+
*/
3033
public function jsonSerialize()
3134
{
3235
return $this->id;

0 commit comments

Comments
 (0)