Skip to content

Commit

Permalink
chore: Normalizer methods signatures update
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Feb 2, 2024
1 parent 4a5d9fd commit 1aff72e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Serializer/Normalizer/AttributeValueNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class AttributeValueNormalizer extends AbstractPathNormalizer
* @return array|\ArrayObject|bool|float|int|mixed|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$data = $this->decorated->normalize($object, $format, $context);
if ($object instanceof AttributeValue && is_array($data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/Normalizer/CustomFormNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class CustomFormNormalizer extends AbstractPathNormalizer
* @return array|\ArrayObject|bool|float|int|mixed|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$data = $this->decorated->normalize($object, $format, $context);
if ($object instanceof CustomForm && is_array($data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/Normalizer/DocumentNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
* @return array|\ArrayObject|bool|float|int|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$data = $this->decorated->normalize($object, $format, $context);
if (
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/Normalizer/DocumentSourcesNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
* @return array|\ArrayObject|bool|float|int|mixed|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$data = $this->decorated->normalize($object, $format, $context);
if ($object instanceof Document && is_array($data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/Normalizer/FolderNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class FolderNormalizer extends AbstractPathNormalizer
* @return array|\ArrayObject|bool|float|int|mixed|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$data = $this->decorated->normalize($object, $format, $context);
if ($object instanceof Folder && is_array($data)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/Normalizer/NodesSourcesPathNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class NodesSourcesPathNormalizer extends AbstractPathNormalizer
* @return array|\ArrayObject|bool|float|int|mixed|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$data = $this->decorated->normalize($object, $format, $context);
if (
Expand Down
10 changes: 5 additions & 5 deletions src/Serializer/Normalizer/RealmSerializationGroupNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
use RZ\Roadiz\CoreBundle\Entity\NodesSources;
use RZ\Roadiz\CoreBundle\Entity\Realm;
use RZ\Roadiz\CoreBundle\Security\Authorization\Voter\RealmVoter;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;

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

Expand All @@ -34,7 +34,7 @@ public function __construct(Security $security, ManagerRegistry $managerRegistry
/**
* @inheritDoc
*/
public function supportsNormalization($data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
{
// Make sure we're not called twice
if (isset($context[self::ALREADY_CALLED])) {
Expand All @@ -48,7 +48,7 @@ public function supportsNormalization($data, string $format = null, array $conte
* @inheritDoc
* @return array|string|int|float|bool|\ArrayObject|null
*/
public function normalize($object, string $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$realms = $this->getAuthorizedRealmsForObject($object);

Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/Normalizer/TagNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class TagNormalizer extends AbstractPathNormalizer
* @return array|\ArrayObject|bool|float|int|mixed|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
$data = $this->decorated->normalize($object, $format, $context);
if (
Expand Down
8 changes: 4 additions & 4 deletions src/Serializer/Normalizer/TranslationAwareNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use RZ\Roadiz\CoreBundle\Preview\PreviewResolverInterface;
use RZ\Roadiz\CoreBundle\Repository\TranslationRepository;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;

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

Expand All @@ -43,7 +43,7 @@ public function __construct(
* @return array|\ArrayObject|bool|float|int|string|null
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
*/
public function normalize($object, $format = null, array $context = [])
public function normalize(mixed $object, ?string $format = null, array $context = []): mixed
{
if ($object instanceof WebResponseInterface) {
$item = $object->getItem();
Expand Down Expand Up @@ -98,7 +98,7 @@ private function getTranslationFromRequest(): ?TranslationInterface
->findDefault();
}

public function supportsNormalization($data, $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
{
// Make sure we're not called twice
if (isset($context[self::ALREADY_CALLED])) {
Expand Down

0 comments on commit 1aff72e

Please sign in to comment.