mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
fix phpstan errors
This commit is contained in:
@@ -22,7 +22,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
||||
private SerializerInterface $serializer;
|
||||
private AccompanyingPeriodWorkRepository $workRepository;
|
||||
private PaginatorFactory $paginator;
|
||||
protected LoggerInterface $logger;
|
||||
private LoggerInterface $chillLogger;
|
||||
|
||||
public function __construct(
|
||||
TranslatorInterface $trans,
|
||||
@@ -35,7 +35,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
||||
$this->serializer = $serializer;
|
||||
$this->workRepository = $workRepository;
|
||||
$this->paginator = $paginator;
|
||||
$this->logger = $logger;
|
||||
$this->chillLogger = $chillLogger;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +133,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
||||
|
||||
if ($form->isValid()) {
|
||||
|
||||
$this->logger->notice("An accompanying period work has been removed", [
|
||||
$this->chillLogger->notice("An accompanying period work has been removed", [
|
||||
'by_user' => $this->getUser()->getUsername(),
|
||||
'work_id' => $work->getId(),
|
||||
'accompanying_period_id' => $work->getAccompanyingPeriod()->getId()
|
||||
@@ -162,6 +162,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
||||
|
||||
private function createDeleteForm(int $id): Form
|
||||
{
|
||||
$params = [];
|
||||
$params['id'] = $id;
|
||||
|
||||
return $this->createFormBuilder()
|
||||
|
@@ -1137,14 +1137,15 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
public function getGroupSequence()
|
||||
{
|
||||
if($this->getStep() == self::STEP_DRAFT)
|
||||
if ($this->getStep() == self::STEP_DRAFT)
|
||||
{
|
||||
return [[self::STEP_DRAFT]];
|
||||
}
|
||||
|
||||
if($this->getStep() == self::STEP_CONFIRMED)
|
||||
} elseif ($this->getStep() == self::STEP_CONFIRMED)
|
||||
{
|
||||
return [[self::STEP_DRAFT, self::STEP_CONFIRMED]];
|
||||
}
|
||||
|
||||
throw new \LogicException("no validation group permitted with this step");
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ class ParticipationOverlapValidator extends ConstraintValidator
|
||||
}
|
||||
|
||||
$overlaps = new DateRangeCovering(self::MAX_PARTICIPATION, $participations[0]->getStartDate()->getTimezone());
|
||||
$participationList = [];
|
||||
|
||||
foreach ($participations as $participation) {
|
||||
|
||||
@@ -38,12 +39,12 @@ class ParticipationOverlapValidator extends ConstraintValidator
|
||||
}
|
||||
|
||||
$personId = $participation->getPerson()->getId();
|
||||
|
||||
$particpationList[$personId][] = $participation;
|
||||
|
||||
$participationList[$personId][] = $participation;
|
||||
|
||||
}
|
||||
|
||||
foreach ($particpationList as $group) {
|
||||
foreach ($participationList as $group) {
|
||||
if (count($group) > 1) {
|
||||
foreach ($group as $p) {
|
||||
$overlaps->add($p->getStartDate(), $p->getEndDate(), $p->getId());
|
||||
@@ -69,4 +70,4 @@ class ParticipationOverlapValidator extends ConstraintValidator
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user