mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 02:25:00 +00:00
Add getSupportedTypes method for (de)normalizerInterface implementations
This commit is contained in:
@@ -183,4 +183,9 @@ class AccompanyingPeriodDocGenNormalizer implements \Symfony\Component\Serialize
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return 'docgen' === $format ? [AccompanyingPeriod::class => true] : [];
|
||||
}
|
||||
}
|
||||
|
@@ -45,4 +45,11 @@ class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterf
|
||||
|
||||
return $data instanceof AccompanyingPeriodParticipation;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return [
|
||||
AccompanyingPeriodParticipation::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -95,4 +95,11 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
|
||||
{
|
||||
return Resource::class === $type;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return [
|
||||
Resource::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -112,4 +112,11 @@ class AccompanyingPeriodWorkDenormalizer implements \Symfony\Component\Serialize
|
||||
$work->addAccompanyingPeriodWorkEvaluation($evaluation);
|
||||
}
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return [
|
||||
AccompanyingPeriodWork::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -103,4 +103,11 @@ class AccompanyingPeriodWorkEvaluationDenormalizer implements \Symfony\Component
|
||||
$evaluation->addDocument($document);
|
||||
}
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return [
|
||||
AccompanyingPeriodWorkEvaluation::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -56,4 +56,11 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements \Symfony\Com
|
||||
|| spl_object_hash($data) !== $context[self::SKIP]
|
||||
);
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return [
|
||||
AccompanyingPeriodWorkEvaluationDocument::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -70,4 +70,9 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements \Symfony\Component\S
|
||||
&& $data instanceof AccompanyingPeriodWorkEvaluation
|
||||
&& !\array_key_exists(self::IGNORE_EVALUATION, $context);
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return 'json' === $format ? [AccompanyingPeriodWorkEvaluation::class => true] : [];
|
||||
}
|
||||
}
|
||||
|
@@ -137,4 +137,12 @@ class AccompanyingPeriodWorkNormalizer implements \Symfony\Component\Serializer\
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return match ($format) {
|
||||
'json', 'docgen' => [AccompanyingPeriodWork::class => true],
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -36,4 +36,11 @@ class GenderDocGenNormalizer implements \Symfony\Component\Serializer\Normalizer
|
||||
'genderTranslation' => $gender->getGenderTranslation(),
|
||||
];
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return [
|
||||
Gender::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -181,4 +181,11 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
|
||||
throw new Exception\UnexpectedValueException("The schema does not have any key 'destination'");
|
||||
}
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return [
|
||||
MembersEditor::class => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -247,4 +247,9 @@ class PersonDocGenNormalizer implements
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return 'docgen' === $format ? [Person::class => true] : [];
|
||||
}
|
||||
}
|
||||
|
@@ -241,4 +241,9 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
)
|
||||
->toArray();
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return 'json' === $format ? [Person::class => true] : [];
|
||||
}
|
||||
}
|
||||
|
@@ -83,4 +83,9 @@ class RelationshipDocGenNormalizer implements \Symfony\Component\Serializer\Norm
|
||||
return $data instanceof Relationship || (null === $data
|
||||
&& Relationship::class === ($context['docgen:expects'] ?? null));
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return 'docgen' === $format ? [Relationship::class => true] : [];
|
||||
}
|
||||
}
|
||||
|
@@ -75,4 +75,15 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
if ('json' === $format || 'docgen' === $format) {
|
||||
return [
|
||||
SocialAction::class => true,
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@@ -48,6 +48,9 @@ class SocialIssueNormalizer implements \Symfony\Component\Serializer\Normalizer\
|
||||
'title' => $socialIssue->getTitle(),
|
||||
'text' => $this->render->renderString($socialIssue, []),
|
||||
];
|
||||
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,4 +72,15 @@ class SocialIssueNormalizer implements \Symfony\Component\Serializer\Normalizer\
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
if ('json' === $format || 'docgen' === $format) {
|
||||
return [
|
||||
SocialIssue::class => true,
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@@ -58,4 +58,9 @@ class WorkflowNormalizer implements \Symfony\Component\Serializer\Normalizer\Nor
|
||||
&& $data instanceof EntityWorkflow
|
||||
&& !\array_key_exists(self::IGNORE_ENTITY_WORKFLOW, $context);
|
||||
}
|
||||
|
||||
public function getSupportedTypes(?string $format): array
|
||||
{
|
||||
return 'json' === $format ? [EntityWorkflow::class => true] : [];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user