mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
sa: Fix all issues related to PHP versions and static-analysis.
This commit is contained in:
@@ -15,10 +15,11 @@ use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
||||
|
||||
use function array_keys;
|
||||
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)) {
|
||||
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;
|
||||
}
|
||||
|
||||
public function supportsEncoding(string $format)
|
||||
public function supportsEncoding($format)
|
||||
{
|
||||
return 'docgen' === $format;
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
|
||||
*
|
||||
* @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 = [];
|
||||
|
||||
@@ -44,7 +44,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null, array $context = [])
|
||||
public function supportsNormalization($data, $format = null, array $context = [])
|
||||
{
|
||||
if ('docgen' !== $format) {
|
||||
return false;
|
||||
|
@@ -55,7 +55,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
$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;
|
||||
|
||||
@@ -96,7 +96,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user