mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix phpstan errors
This commit is contained in:
parent
52dc89c06f
commit
5651efe44d
@ -905,11 +905,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
|
||||
|
||||
-
|
||||
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillMainBundle/Util/DateRangeCovering.php
|
||||
|
||||
-
|
||||
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
|
||||
count: 2
|
||||
|
@ -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) {
|
||||
|
||||
@ -39,11 +40,11 @@ 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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user