php style fixer

This commit is contained in:
2024-02-12 14:37:54 +01:00
parent 1b96deb4ee
commit addc623add
6 changed files with 35 additions and 22 deletions

View File

@@ -394,6 +394,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
/**
* @return ReadableCollection<int, User>
*
* @Serializer\Groups({"accompanying_period_work:edit"})
*/
public function getReferrers(): ReadableCollection

View File

@@ -63,13 +63,15 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
continue;
}
$initial['referrers'][] = $this->normalizer->normalize($referrerHistory->getUser(),
$format, [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]);
$initial['referrers'][] = $this->normalizer->normalize(
$referrerHistory->getUser(),
$format,
[...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]
);
}
}
if ($format === 'json') {
if ('json' === $format) {
// then, we add normalization for things which are not into the entity
$initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(
AccompanyingPeriodWork::class,
@@ -98,7 +100,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
{
return ('json' === $format || 'docgen' === $format)
&& ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && $data === null && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class))
&& ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && null === $data && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class))
&& !\array_key_exists(self::IGNORE_WORK, $context);
}
}