mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix ::canBeReOpened
.
1. Fix call to `::getOpenParticipationContainsPerson` instead of `::getParticipationsContainsPerson`. 2. Use early returns to reduce cyclomatic complexity. 3. Avoid storing variable that are used only once.
This commit is contained in:
parent
a6e0b16032
commit
484259c8ab
@ -435,15 +435,16 @@ class AccompanyingPeriod
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$participation = $this->getParticipationsContainsPerson($person);
|
$participation = $this->getOpenParticipationContainsPerson($person);
|
||||||
if (!null === $participation)
|
|
||||||
|
if (null === $participation)
|
||||||
{
|
{
|
||||||
$person = $participation->getPerson();
|
return false;
|
||||||
$periods = $person->getAccompanyingPeriodsOrdered();
|
|
||||||
return end($periods) === $this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
$periods = $participation->getPerson()->getAccompanyingPeriodsOrdered();
|
||||||
|
|
||||||
|
return end($periods) === $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user