Skip to content

Commit

Permalink
Add return type and php docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre.rebeilleau committed Oct 12, 2021
1 parent 0d37caa commit efee3ab
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/Bridge/RamseyUuid/Identifier/Normalizer/UuidNormalizer.php
Expand Up @@ -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 = [])
{
Expand All @@ -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);
}
Expand Down
9 changes: 8 additions & 1 deletion src/Bridge/RamseyUuid/Serializer/UuidDenormalizer.php
Expand Up @@ -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 {
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Action/EntrypointActionTest.php
Expand Up @@ -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']));
Expand Down
2 changes: 2 additions & 0 deletions tests/Fixtures/ArrayAccessible.php
Expand Up @@ -29,6 +29,8 @@ public function offsetExists($offset): bool
}

/**
* @param mixed $offset
*
* @return mixed
*/
#[\ReturnTypeWillChange]
Expand Down
3 changes: 3 additions & 0 deletions tests/Fixtures/TestBundle/Doctrine/Generator/Uuid.php
Expand Up @@ -27,6 +27,9 @@ public function __toString()
return $this->id;
}

/**
* @return mixed
*/
public function jsonSerialize()
{
return $this->id;
Expand Down

0 comments on commit efee3ab

Please sign in to comment.