mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
sa: Fix all issues related to PHP versions and static-analysis.
This commit is contained in:
@@ -49,7 +49,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
|
||||
/**
|
||||
* @param Address $address
|
||||
*/
|
||||
public function normalize($address, ?string $format = null, array $context = [])
|
||||
public function normalize($address, $format = null, array $context = [])
|
||||
{
|
||||
if ($address instanceof Address) {
|
||||
$text = $address->isNoAddress() ? '' : $address->getStreet() . ', ' . $address->getStreetNumber();
|
||||
@@ -118,7 +118,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw
|
||||
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) {
|
||||
return $data instanceof Address;
|
||||
|
@@ -29,7 +29,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
|
||||
$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)) {
|
||||
throw new InvalidArgumentException('missing "type" key in data');
|
||||
@@ -52,7 +52,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
|
||||
return $center;
|
||||
}
|
||||
|
||||
public function normalize($center, ?string $format = null, array $context = [])
|
||||
public function normalize($center, $format = null, array $context = [])
|
||||
{
|
||||
/** @var Center $center */
|
||||
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;
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null): bool
|
||||
public function supportsNormalization($data, $format = null): bool
|
||||
{
|
||||
return $data instanceof Center && 'json' === $format;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
public function normalize($collection, ?string $format = null, array $context = [])
|
||||
public function normalize($collection, $format = null, array $context = [])
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
$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) {
|
||||
return null;
|
||||
@@ -54,7 +54,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
throw new UnexpectedValueException();
|
||||
}
|
||||
|
||||
public function normalize($date, ?string $format = null, array $context = [])
|
||||
public function normalize($date, $format = null, array $context = [])
|
||||
{
|
||||
/** @var DateTimeInterface $date */
|
||||
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
|
||||
|| DateTime::class === $type
|
||||
@@ -99,7 +99,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
|
||||
|| (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) {
|
||||
return $data instanceof DateTimeInterface;
|
||||
|
@@ -38,7 +38,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
|
||||
*/
|
||||
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) {
|
||||
if ($this->denormalizer->supportsDenormalization($data, $localType, $format)) {
|
||||
@@ -54,7 +54,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
|
||||
'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) {
|
||||
return false;
|
||||
|
@@ -33,7 +33,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface
|
||||
$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)) {
|
||||
return $context[AbstractNormalizer::OBJECT_TO_POPULATE];
|
||||
@@ -43,7 +43,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface
|
||||
->find($data['id']);
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, ?string $format = null)
|
||||
public function supportsDenormalization($data, $type, $format = null)
|
||||
{
|
||||
if (false === is_array($data)) {
|
||||
return false;
|
||||
|
@@ -20,7 +20,7 @@ use function is_array;
|
||||
|
||||
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)) {
|
||||
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]);
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, ?string $format = null): bool
|
||||
public function supportsDenormalization($data, $type, $format = null): bool
|
||||
{
|
||||
return Point::class === $type;
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware
|
||||
$this->userRender = $userRender;
|
||||
}
|
||||
|
||||
public function normalize($user, ?string $format = null, array $context = [])
|
||||
public function normalize($user, $format = null, array $context = [])
|
||||
{
|
||||
/** @var User $user */
|
||||
$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)) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user