mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-11 07:49:43 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -23,7 +23,7 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface
|
||||
* @param Origin $origin
|
||||
* @param string|null $format
|
||||
*/
|
||||
public function normalize($origin, $format = null, array $context = [])
|
||||
public function normalize($origin, $format = null, array $context = []): string|int|float|bool|\ArrayObject|array|null
|
||||
{
|
||||
return [
|
||||
'type' => 'origin',
|
||||
@@ -33,8 +33,19 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, $format = null): bool
|
||||
public function supportsNormalization($data, $format = null, array $context = []): bool
|
||||
{
|
||||
return $data instanceof Origin && 'json' === $format;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
if ('json' !== $format) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
Origin::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user