sa: Fix all issues related to PHP versions and static-analysis.

This commit is contained in:
Pol Dellaiera 2021-12-21 11:58:58 +01:00
parent b3823161af
commit b743475761
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
25 changed files with 79 additions and 81 deletions

View File

@ -417,15 +417,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
-
message:
"""
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 3
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
- -
message: message:
""" """
@ -435,15 +426,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
-
message:
"""
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php
- -
message: message:
""" """

View File

@ -15,10 +15,11 @@ use Symfony\Component\Serializer\Exception\UnexpectedValueException;
use function array_keys; use function array_keys;
use function is_array; use function is_array;
use Symfony\Component\Serializer\Encoder\EncoderInterface;
class DocGenEncoder implements \Symfony\Component\Serializer\Encoder\EncoderInterface class DocGenEncoder implements EncoderInterface
{ {
public function encode($data, string $format, array $context = []) public function encode($data, $format, array $context = [])
{ {
if (!$this->isAssociative($data)) { if (!$this->isAssociative($data)) {
throw new UnexpectedValueException('Only associative arrays are allowed; lists are not allowed'); throw new UnexpectedValueException('Only associative arrays are allowed; lists are not allowed');
@ -30,7 +31,7 @@ class DocGenEncoder implements \Symfony\Component\Serializer\Encoder\EncoderInte
return $result; return $result;
} }
public function supportsEncoding(string $format) public function supportsEncoding($format)
{ {
return 'docgen' === $format; return 'docgen' === $format;
} }

View File

@ -29,7 +29,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
* *
* @return array|ArrayObject|bool|float|int|string|void|null * @return array|ArrayObject|bool|float|int|string|void|null
*/ */
public function normalize($object, ?string $format = null, array $context = []) public function normalize($object, $format = null, array $context = [])
{ {
$data = []; $data = [];
@ -44,7 +44,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
return $data; return $data;
} }
public function supportsNormalization($data, ?string $format = null, array $context = []) public function supportsNormalization($data, $format = null, array $context = [])
{ {
if ('docgen' !== $format) { if ('docgen' !== $format) {
return false; return false;

View File

@ -55,7 +55,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
$this->translatableStringHelper = $translatableStringHelper; $this->translatableStringHelper = $translatableStringHelper;
} }
public function normalize($object, ?string $format = null, array $context = []) public function normalize($object, $format = null, array $context = [])
{ {
$classMetadataKey = $object ?? $context['docgen:expects'] ?? null; $classMetadataKey = $object ?? $context['docgen:expects'] ?? null;
@ -96,7 +96,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
return $this->normalizeObject($object, $format, $context, $expectedGroups, $metadata, $attributes); return $this->normalizeObject($object, $format, $context, $expectedGroups, $metadata, $attributes);
} }
public function supportsNormalization($data, ?string $format = null): bool public function supportsNormalization($data, $format = null): bool
{ {
return 'docgen' === $format && (is_object($data) || null === $data); return 'docgen' === $format && (is_object($data) || null === $data);
} }

View File

@ -49,7 +49,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
/** /**
* @param Address $address * @param Address $address
*/ */
public function normalize($address, ?string $format = null, array $context = []) public function normalize($address, $format = null, array $context = [])
{ {
if ($address instanceof Address) { if ($address instanceof Address) {
$text = $address->isNoAddress() ? '' : $address->getStreet() . ', ' . $address->getStreetNumber(); $text = $address->isNoAddress() ? '' : $address->getStreet() . ', ' . $address->getStreetNumber();
@ -118,7 +118,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
throw new UnexpectedValueException(); throw new UnexpectedValueException();
} }
public function supportsNormalization($data, ?string $format = null, array $context = []): bool public function supportsNormalization($data, $format = null, array $context = []): bool
{ {
if ('json' === $format) { if ('json' === $format) {
return $data instanceof Address; return $data instanceof Address;

View File

@ -29,7 +29,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
$this->repository = $repository; $this->repository = $repository;
} }
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
if (false === array_key_exists('type', $data)) { if (false === array_key_exists('type', $data)) {
throw new InvalidArgumentException('missing "type" key in data'); throw new InvalidArgumentException('missing "type" key in data');
@ -52,7 +52,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
return $center; return $center;
} }
public function normalize($center, ?string $format = null, array $context = []) public function normalize($center, $format = null, array $context = [])
{ {
/** @var Center $center */ /** @var Center $center */
return [ return [
@ -62,12 +62,12 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
]; ];
} }
public function supportsDenormalization($data, string $type, ?string $format = null) public function supportsDenormalization($data, $type, $format = null)
{ {
return Center::class === $type; return Center::class === $type;
} }
public function supportsNormalization($data, ?string $format = null): bool public function supportsNormalization($data, $format = null): bool
{ {
return $data instanceof Center && 'json' === $format; return $data instanceof Center && 'json' === $format;
} }

View File

@ -23,7 +23,7 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf
/** /**
* @param Collection $collection * @param Collection $collection
*/ */
public function normalize($collection, ?string $format = null, array $context = []) public function normalize($collection, $format = null, array $context = [])
{ {
$paginator = $collection->getPaginator(); $paginator = $collection->getPaginator();
@ -40,7 +40,7 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf
]; ];
} }
public function supportsNormalization($data, ?string $format = null): bool public function supportsNormalization($data, $format = null): bool
{ {
return $data instanceof Collection; return $data instanceof Collection;
} }

View File

@ -36,7 +36,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
$this->parameterBag = $parameterBag; $this->parameterBag = $parameterBag;
} }
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
if (null === $data) { if (null === $data) {
return null; return null;
@ -54,7 +54,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
throw new UnexpectedValueException(); throw new UnexpectedValueException();
} }
public function normalize($date, ?string $format = null, array $context = []) public function normalize($date, $format = null, array $context = [])
{ {
/** @var DateTimeInterface $date */ /** @var DateTimeInterface $date */
switch ($format) { switch ($format) {
@ -91,7 +91,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
} }
} }
public function supportsDenormalization($data, string $type, ?string $format = null): bool public function supportsDenormalization($data, $type, $format = null): bool
{ {
return DateTimeInterface::class === $type return DateTimeInterface::class === $type
|| DateTime::class === $type || DateTime::class === $type
@ -99,7 +99,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|| (is_array($data) && array_key_exists('datetime', $data)); || (is_array($data) && array_key_exists('datetime', $data));
} }
public function supportsNormalization($data, ?string $format = null, array $context = []): bool public function supportsNormalization($data, $format = null, array $context = []): bool
{ {
if ('json' === $format) { if ('json' === $format) {
return $data instanceof DateTimeInterface; return $data instanceof DateTimeInterface;

View File

@ -38,7 +38,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
*/ */
public const TYPE = '@multi'; public const TYPE = '@multi';
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
foreach ($context[self::ALLOWED_TYPES] as $localType) { foreach ($context[self::ALLOWED_TYPES] as $localType) {
if ($this->denormalizer->supportsDenormalization($data, $localType, $format)) { if ($this->denormalizer->supportsDenormalization($data, $localType, $format)) {
@ -54,7 +54,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
'ALLOWED_TYPES: %s', implode(', ', $context[self::ALLOWED_TYPES]))); 'ALLOWED_TYPES: %s', implode(', ', $context[self::ALLOWED_TYPES])));
} }
public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []) public function supportsDenormalization($data, $type, $format = null, array $context = [])
{ {
if (self::TYPE !== $type) { if (self::TYPE !== $type) {
return false; return false;

View File

@ -33,7 +33,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface
$this->serializerMetadataFactory = $serializerMetadataFactory; $this->serializerMetadataFactory = $serializerMetadataFactory;
} }
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
if (array_key_exists(AbstractNormalizer::OBJECT_TO_POPULATE, $context)) { if (array_key_exists(AbstractNormalizer::OBJECT_TO_POPULATE, $context)) {
return $context[AbstractNormalizer::OBJECT_TO_POPULATE]; return $context[AbstractNormalizer::OBJECT_TO_POPULATE];
@ -43,7 +43,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface
->find($data['id']); ->find($data['id']);
} }
public function supportsDenormalization($data, string $type, ?string $format = null) public function supportsDenormalization($data, $type, $format = null)
{ {
if (false === is_array($data)) { if (false === is_array($data)) {
return false; return false;

View File

@ -20,7 +20,7 @@ use function is_array;
class PointNormalizer implements DenormalizerInterface class PointNormalizer implements DenormalizerInterface
{ {
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
if (!is_array($data)) { if (!is_array($data)) {
throw new InvalidArgumentException('point data is not an array. It should be an array of 2 coordinates.'); throw new InvalidArgumentException('point data is not an array. It should be an array of 2 coordinates.');
@ -33,7 +33,7 @@ class PointNormalizer implements DenormalizerInterface
return Point::fromLonLat($data[0], $data[1]); return Point::fromLonLat($data[0], $data[1]);
} }
public function supportsDenormalization($data, string $type, ?string $format = null): bool public function supportsDenormalization($data, $type, $format = null): bool
{ {
return Point::class === $type; return Point::class === $type;
} }

View File

@ -40,7 +40,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
$this->userRender = $userRender; $this->userRender = $userRender;
} }
public function normalize($user, ?string $format = null, array $context = []) public function normalize($user, $format = null, array $context = [])
{ {
/** @var User $user */ /** @var User $user */
$userJobContext = array_merge( $userJobContext = array_merge(
@ -77,7 +77,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
]; ];
} }
public function supportsNormalization($data, ?string $format = null, array $context = []): bool public function supportsNormalization($data, $format = null, array $context = []): bool
{ {
if ($data instanceof User && ('json' === $format || 'docgen' === $format)) { if ($data instanceof User && ('json' === $format || 'docgen' === $format)) {
return true; return true;

View File

@ -19,6 +19,7 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use function array_key_exists; use function array_key_exists;
@ -37,6 +38,7 @@ class AccompanyingCourseCommentController extends AbstractController
$newComment->setAccompanyingPeriod($accompanyingCourse); $newComment->setAccompanyingPeriod($accompanyingCourse);
$form = $this->createCommentForm($newComment, 'new'); $form = $this->createCommentForm($newComment, 'new');
$editForm = null;
if ($request->query->has('edit')) { if ($request->query->has('edit')) {
foreach ($accompanyingCourse->getComments() as $comment) { foreach ($accompanyingCourse->getComments() as $comment) {
@ -53,12 +55,16 @@ class AccompanyingCourseCommentController extends AbstractController
} }
} }
if (null === $editForm) {
throw new NotFoundHttpException('Unable to find an edit form.');
}
if ($request->getMethod() === Request::METHOD_POST) { if ($request->getMethod() === Request::METHOD_POST) {
$currentForm = $editForm->handleRequest($request);
if (array_key_exists('edit', $request->request->all()[$editForm->getName()])) { if (array_key_exists('edit', $request->request->all()[$editForm->getName()])) {
$currentForm = $editForm->handleRequest($request);
$isEditingNew = false; $isEditingNew = false;
} else { } else {
$currentForm = $form->handleRequest($request);
$isEditingNew = true; $isEditingNew = true;
} }
@ -79,7 +85,7 @@ class AccompanyingCourseCommentController extends AbstractController
return $this->render('@ChillPerson/AccompanyingCourse/comment_list.html.twig', [ return $this->render('@ChillPerson/AccompanyingCourse/comment_list.html.twig', [
'accompanyingCourse' => $accompanyingCourse, 'accompanyingCourse' => $accompanyingCourse,
'form' => $form->createView(), 'form' => $form->createView(),
'edit_form' => isset($editForm) ? $editForm->createView() : null, 'edit_form' => $editForm !== null ? $editForm->createView() : null,
'commentEditId' => $commentEditId ?? null, 'commentEditId' => $commentEditId ?? null,
]); ]);
} }

View File

@ -94,7 +94,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
/** /**
* @param AccompanyingPeriod|null $period * @param AccompanyingPeriod|null $period
*/ */
public function normalize($period, ?string $format = null, array $context = []) public function normalize($period, $format = null, array $context = [])
{ {
if ($period instanceof AccompanyingPeriod) { if ($period instanceof AccompanyingPeriod) {
$scopes = $this->scopeResolverDispatcher->isConcerned($period) ? $this->scopeResolverDispatcher->resolveScope($period) : []; $scopes = $this->scopeResolverDispatcher->isConcerned($period) ? $this->scopeResolverDispatcher->resolveScope($period) : [];
@ -147,7 +147,9 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
'hasRequestor' => $period->getRequestor() !== null, 'hasRequestor' => $period->getRequestor() !== null,
'requestorKind' => $period->getRequestorKind(), 'requestorKind' => $period->getRequestorKind(),
]; ];
} elseif (null === $period) { }
if (null === $period) {
return array_merge( return array_merge(
(new NormalizeNullValueHelper($this->normalizer, 'type', 'accompanying_period')) (new NormalizeNullValueHelper($this->normalizer, 'type', 'accompanying_period'))
->normalize(self::PERIOD_NULL, $format, $context), ->normalize(self::PERIOD_NULL, $format, $context),
@ -163,10 +165,10 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf
); );
} }
throw new InvalidArgumentException('this neither an accompanying period or null'); throw new InvalidArgumentException('This neither an accompanying period or null.');
} }
public function supportsNormalization($data, ?string $format = null, array $context = []): bool public function supportsNormalization($data, $format = null, array $context = []): bool
{ {
if ('docgen' !== $format) { if ('docgen' !== $format) {
return false; return false;

View File

@ -19,9 +19,12 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
*/ */
final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface
{ {
public function normalize($origin, ?string $format = null, array $context = [])
/**
* @param Origin $origin
*/
public function normalize($origin, $format = null, array $context = [])
{ {
/** @var Origin $origin */
return [ return [
'type' => 'origin', 'type' => 'origin',
'id' => $origin->getId(), 'id' => $origin->getId(),
@ -30,7 +33,7 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface
]; ];
} }
public function supportsNormalization($data, ?string $format = null): bool public function supportsNormalization($data, $format = null): bool
{ {
return $data instanceof Origin; return $data instanceof Origin;
} }

View File

@ -17,11 +17,13 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterface, NormalizerInterface class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterface, NormalizerInterface
{ {
protected ?NormalizerInterface $normalizer = null; private ?NormalizerInterface $normalizer = null;
public function normalize($participation, ?string $format = null, array $context = []) /**
* @param AccompanyingPeriodParticipation $participation
*/
public function normalize($participation, $format = null, array $context = [])
{ {
/** @var AccompanyingPeriodParticipation $participation */
return [ return [
'id' => $participation->getId(), 'id' => $participation->getId(),
'startDate' => $this->normalizer->normalize($participation->getStartDate(), $format), 'startDate' => $this->normalizer->normalize($participation->getStartDate(), $format),
@ -35,8 +37,9 @@ class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterf
$this->normalizer = $normalizer; $this->normalizer = $normalizer;
} }
public function supportsNormalization($data, ?string $format = null): bool public function supportsNormalization($data, $format = null): bool
{ {
// @TODO Fix this.
return false; return false;
return $data instanceof AccompanyingPeriodParticipation; return $data instanceof AccompanyingPeriodParticipation;

View File

@ -38,7 +38,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
$this->repository = $repository; $this->repository = $repository;
} }
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
$resource = $this->extractObjectToPopulate($type, $context); $resource = $this->extractObjectToPopulate($type, $context);
@ -87,7 +87,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
return $resource; return $resource;
} }
public function supportsDenormalization($data, string $type, ?string $format = null) public function supportsDenormalization($data, $type, $format = null)
{ {
return Resource::class === $type; return Resource::class === $type;
} }

View File

@ -51,7 +51,7 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte
$this->em = $em; $this->em = $em;
} }
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
$work = $this->denormalizer->denormalize($data, $type, $format, array_merge( $work = $this->denormalizer->denormalize($data, $type, $format, array_merge(
$context, $context,
@ -65,7 +65,7 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte
return $work; return $work;
} }
public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
{ {
return AccompanyingPeriodWork::class === $type return AccompanyingPeriodWork::class === $type
&& self::class !== ($context['skip'] ?? null) && self::class !== ($context['skip'] ?? null)

View File

@ -35,7 +35,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
$this->factory = $factory; $this->factory = $factory;
} }
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
// some test about schema first... // some test about schema first...
$this->performChecks($data); $this->performChecks($data);
@ -50,7 +50,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
return $this->denormalizeMove($data, $type, $format, $context); return $this->denormalizeMove($data, $type, $format, $context);
} }
public function supportsDenormalization($data, string $type, ?string $format = null) public function supportsDenormalization($data, $type, $format = null)
{ {
return MembersEditor::class === $type; return MembersEditor::class === $type;
} }

View File

@ -57,7 +57,7 @@ class PersonDocGenNormalizer implements
$this->translatableStringHelper = $translatableStringHelper; $this->translatableStringHelper = $translatableStringHelper;
} }
public function normalize($person, ?string $format = null, array $context = []) public function normalize($person, $format = null, array $context = [])
{ {
/** @var Person $person */ /** @var Person $person */
$dateContext = $context; $dateContext = $context;
@ -132,7 +132,7 @@ class PersonDocGenNormalizer implements
return $data; return $data;
} }
public function supportsNormalization($data, ?string $format = null, array $context = []) public function supportsNormalization($data, $format = null, array $context = [])
{ {
if ('docgen' !== $format) { if ('docgen' !== $format) {
return false; return false;

View File

@ -59,7 +59,7 @@ class PersonJsonNormalizer implements
$this->centerResolverManager = $centerResolverManager; $this->centerResolverManager = $centerResolverManager;
} }
public function denormalize($data, string $type, ?string $format = null, array $context = []) public function denormalize($data, $type, $format = null, array $context = [])
{ {
$person = $this->extractObjectToPopulate($type, $context); $person = $this->extractObjectToPopulate($type, $context);
@ -140,12 +140,13 @@ class PersonJsonNormalizer implements
return $person; return $person;
} }
public function normalize($person, ?string $format = null, array $context = []) /**
* @param Person $person
*/
public function normalize($person, $format = null, array $context = [])
{ {
/** @var Household $household */
$household = $person->getCurrentHousehold(); $household = $person->getCurrentHousehold();
/** @var Person $person */
return [ return [
'type' => 'person', 'type' => 'person',
'id' => $person->getId(), 'id' => $person->getId(),
@ -164,12 +165,12 @@ class PersonJsonNormalizer implements
]; ];
} }
public function supportsDenormalization($data, string $type, ?string $format = null) public function supportsDenormalization($data, $type, $format = null)
{ {
return Person::class === $type && 'person' === ($data['type'] ?? null); return Person::class === $type && 'person' === ($data['type'] ?? null);
} }
public function supportsNormalization($data, ?string $format = null): bool public function supportsNormalization($data, $format = null): bool
{ {
return $data instanceof Person && 'json' === $format; return $data instanceof Person && 'json' === $format;
} }

View File

@ -32,7 +32,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N
/** /**
* @param Relationship $relation * @param Relationship $relation
*/ */
public function normalize($relation, ?string $format = null, array $context = []) public function normalize($relation, $format = null, array $context = [])
{ {
$counterpart = $context['docgen:relationship:counterpart'] ?? null; $counterpart = $context['docgen:relationship:counterpart'] ?? null;
$contextPerson = array_merge($context, [ $contextPerson = array_merge($context, [
@ -78,7 +78,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N
]; ];
} }
public function supportsNormalization($data, ?string $format = null, array $context = []) public function supportsNormalization($data, $format = null, array $context = [])
{ {
if ('docgen' !== $format) { if ('docgen' !== $format) {
return false; return false;

View File

@ -28,7 +28,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
$this->render = $render; $this->render = $render;
} }
public function normalize($socialAction, ?string $format = null, array $context = []) public function normalize($socialAction, $format = null, array $context = [])
{ {
switch ($format) { switch ($format) {
case 'json': case 'json':
@ -58,7 +58,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
} }
} }
public function supportsNormalization($data, ?string $format = null, array $context = []) public function supportsNormalization($data, $format = null, array $context = [])
{ {
if ($data instanceof SocialAction && 'json' === $format) { if ($data instanceof SocialAction && 'json' === $format) {
return true; return true;

View File

@ -28,7 +28,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
$this->render = $render; $this->render = $render;
} }
public function normalize($socialIssue, ?string $format = null, array $context = []) public function normalize($socialIssue, $format = null, array $context = [])
{ {
/** @var SocialIssue $socialIssue */ /** @var SocialIssue $socialIssue */
switch ($format) { switch ($format) {
@ -57,7 +57,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz
} }
} }
public function supportsNormalization($data, ?string $format = null, array $context = []) public function supportsNormalization($data, $format = null, array $context = [])
{ {
if ($data instanceof SocialIssue && 'json' === $format) { if ($data instanceof SocialIssue && 'json' === $format) {
return true; return true;

View File

@ -31,7 +31,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
/** /**
* @param ThirdParty $thirdParty * @param ThirdParty $thirdParty
*/ */
public function normalize($thirdParty, ?string $format = null, array $context = []) public function normalize($thirdParty, $format = null, array $context = [])
{ {
return [ return [
'type' => 'thirdparty', 'type' => 'thirdparty',
@ -49,7 +49,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf
]; ];
} }
public function supportsNormalization($data, ?string $format = null) public function supportsNormalization($data, $format = null)
{ {
return $data instanceof ThirdParty && 'json' === $format; return $data instanceof ThirdParty && 'json' === $format;
} }