mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Correct 2 phpstan errors, condition is always true and wrong typing
This commit is contained in:
@@ -57,20 +57,19 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac
|
||||
// add the referrers
|
||||
$initial['referrers'] = [];
|
||||
|
||||
if ($object instanceof AccompanyingPeriodWork) {
|
||||
foreach ($object->getReferrersHistory() as $referrerHistory) {
|
||||
if (null !== $referrerHistory->getEndDate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$initial['referrers'][] = $this->normalizer->normalize(
|
||||
$referrerHistory->getUser(),
|
||||
$format,
|
||||
[...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]
|
||||
);
|
||||
foreach ($object->getReferrersHistory() as $referrerHistory) {
|
||||
if (null !== $referrerHistory->getEndDate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$initial['referrers'][] = $this->normalizer->normalize(
|
||||
$referrerHistory->getUser(),
|
||||
$format,
|
||||
[...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ('json' === $format) {
|
||||
// then, we add normalization for things which are not into the entity
|
||||
$initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(
|
||||
|
Reference in New Issue
Block a user