From efee3abe394ef1786fbea5c5dcf64cecab3df9f2 Mon Sep 17 00:00:00 2001 From: "pierre.rebeilleau" Date: Tue, 12 Oct 2021 15:43:27 +0200 Subject: [PATCH 1/3] Add return type and php docs --- .../Identifier/Normalizer/UuidNormalizer.php | 10 ++++++++-- src/Bridge/RamseyUuid/Serializer/UuidDenormalizer.php | 9 ++++++++- tests/Action/EntrypointActionTest.php | 2 +- tests/Fixtures/ArrayAccessible.php | 2 ++ tests/Fixtures/TestBundle/Doctrine/Generator/Uuid.php | 3 +++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php b/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php index 8a3ce082486..127cf1e3656 100644 --- a/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php +++ b/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php @@ -27,7 +27,13 @@ final class UuidNormalizer implements DenormalizerInterface { /** - * {@inheritdoc} + * @param mixed $data + * @param string $class + * @param null $format + * + * @throws InvalidIdentifierException + * + * @return mixed */ public function denormalize($data, $class, $format = null, array $context = []) { @@ -41,7 +47,7 @@ public function denormalize($data, $class, $format = null, array $context = []) /** * {@inheritdoc} */ - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization($data, $type, $format = null): bool { return \is_string($data) && is_a($type, UuidInterface::class, true); } diff --git a/src/Bridge/RamseyUuid/Serializer/UuidDenormalizer.php b/src/Bridge/RamseyUuid/Serializer/UuidDenormalizer.php index 8a8ff7abe63..9e5d9df749f 100644 --- a/src/Bridge/RamseyUuid/Serializer/UuidDenormalizer.php +++ b/src/Bridge/RamseyUuid/Serializer/UuidDenormalizer.php @@ -21,6 +21,13 @@ final class UuidDenormalizer implements DenormalizerInterface { + /** + * @param mixed $data + * @param string $type + * @param null $format + * + * @return mixed + */ public function denormalize($data, $type, $format = null, array $context = []) { try { @@ -30,7 +37,7 @@ public function denormalize($data, $type, $format = null, array $context = []) } } - public function supportsDenormalization($data, $type, $format = null) + public function supportsDenormalization($data, $type, $format = null): bool { return \is_string($data) && is_a($type, UuidInterface::class, true); } diff --git a/tests/Action/EntrypointActionTest.php b/tests/Action/EntrypointActionTest.php index 1baaae6b784..194778b62e3 100644 --- a/tests/Action/EntrypointActionTest.php +++ b/tests/Action/EntrypointActionTest.php @@ -27,7 +27,7 @@ class EntrypointActionTest extends TestCase { use ProphecyTrait; - public function testGetEntrypoint() + public function testGetEntrypoint(): void { $resourceNameCollectionFactoryProphecy = $this->prophesize(ResourceNameCollectionFactoryInterface::class); $resourceNameCollectionFactoryProphecy->create()->willReturn(new ResourceNameCollection(['dummies'])); diff --git a/tests/Fixtures/ArrayAccessible.php b/tests/Fixtures/ArrayAccessible.php index 2f0a9e19b66..8ded6c51b7f 100644 --- a/tests/Fixtures/ArrayAccessible.php +++ b/tests/Fixtures/ArrayAccessible.php @@ -29,6 +29,8 @@ public function offsetExists($offset): bool } /** + * @param mixed $offset + * * @return mixed */ #[\ReturnTypeWillChange] diff --git a/tests/Fixtures/TestBundle/Doctrine/Generator/Uuid.php b/tests/Fixtures/TestBundle/Doctrine/Generator/Uuid.php index a2ccebcc418..42af3d22004 100644 --- a/tests/Fixtures/TestBundle/Doctrine/Generator/Uuid.php +++ b/tests/Fixtures/TestBundle/Doctrine/Generator/Uuid.php @@ -27,6 +27,9 @@ public function __toString() return $this->id; } + /** + * @return mixed + */ public function jsonSerialize() { return $this->id; From 1ce8d5cdb70f8f6518f12b35acbe1940fc6e8b6f Mon Sep 17 00:00:00 2001 From: "pierre.rebeilleau" Date: Wed, 13 Oct 2021 10:01:46 +0200 Subject: [PATCH 2/3] Fix inheritdoc missing --- src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php b/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php index 127cf1e3656..7d12a8af293 100644 --- a/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php +++ b/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php @@ -27,6 +27,8 @@ final class UuidNormalizer implements DenormalizerInterface { /** + * {@inheritDoc} + * * @param mixed $data * @param string $class * @param null $format From 9bebe0632d5e2626a879dd142058ce7ab3ed44dd Mon Sep 17 00:00:00 2001 From: Pierre Rebeilleau <49146882+PierreRebeilleau@users.noreply.github.com> Date: Wed, 13 Oct 2021 12:28:15 +0200 Subject: [PATCH 3/3] Update src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kévin Dunglas --- src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php b/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php index 7d12a8af293..107d0f2f84e 100644 --- a/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php +++ b/src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php @@ -27,7 +27,7 @@ final class UuidNormalizer implements DenormalizerInterface { /** - * {@inheritDoc} + * {@inheritdoc} * * @param mixed $data * @param string $class