Skip to content

Commit

Permalink
Signature update
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Jun 5, 2024
1 parent b32704c commit bfeba75
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Serializer/JsonRpc/JsonRpcDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function supportsDecoding($format, array $context = []): bool
*
* @throws JsonException
*/
public function decode($data, $format, array $context = [])
public function decode(string $data, string $format, array $context = []): mixed
{
if ('' === trim($data)) {
throw new UnexpectedValueException('Invalid JSON data, it can not be empty.');
Expand Down
4 changes: 2 additions & 2 deletions src/Serializer/NullOdooRelationDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array
return [OdooRelation::class => false];
}

public function supportsDenormalization($data, $type, $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
if ($type !== OdooRelation::class) {
return false;
Expand All @@ -28,7 +28,7 @@ public function supportsDenormalization($data, $type, $format = null): bool
return false === $data;
}

public function denormalize($data, $type, $format = null, array $context = [])
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
{
if (false === $data) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/Serializer/NullableDateTimeDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ public function getSupportedTypes(?string $format): array
];
}

public function denormalize($data, string $type, string $format = null, array $context = [])
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
{
return null;
}

public function supportsDenormalization($data, string $type, string $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
if (!\is_string($data) || '' === trim($data)) {
return $this->dateTimeNormalizer->supportsDenormalization($data, $type, $format);
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/OdooRelationDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array
return [OdooRelation::class => false];
}

public function supportsDenormalization($data, $type, $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
if ($type !== OdooRelation::class) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/OdooRelationNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function getSupportedTypes(?string $format): array
return [OdooRelation::class => true];
}

public function supportsNormalization($data, $format = null): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof OdooRelation;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/OdooRelationSingleDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array
return [OdooRelation::class => false];
}

public function supportsDenormalization($data, $type, $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
if ($type !== OdooRelation::class) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/OdooRelationsDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getSupportedTypes(?string $format): array
return [OdooRelation::class => false];
}

public function supportsDenormalization($data, $type, $format = null): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
if ($type !== OdooRelation::class) {
return false;
Expand Down
3 changes: 1 addition & 2 deletions src/Serializer/OdooRelationsNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

use FluxSE\OdooApiClient\Model\OdooRelation;
use Symfony\Component\Serializer\Exception\NotNormalizableValueException;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;

final class OdooRelationsNormalizer implements NormalizerInterface, NormalizerAwareInterface, ContextAwareNormalizerInterface
final class OdooRelationsNormalizer implements NormalizerInterface, NormalizerAwareInterface
{
use NormalizerAwareTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/XmlRpc/XmlRpcDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function supportsDecoding($format, array $context = []): bool
/**
* @return array|integer|string|boolean
*/
public function decode($data, $format, array $context = [])
public function decode(string $data, string $format, array $context = []): mixed
{
if ('' === trim($data)) {
throw new UnexpectedValueException('Invalid XML data, it can not be empty.');
Expand Down

0 comments on commit bfeba75

Please sign in to comment.