mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-09 17:29:51 +00:00
fix phpstan errors
This commit is contained in:
parent
52dc89c06f
commit
5651efe44d
@ -905,11 +905,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
|
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\\.$#"
|
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
|
||||||
count: 2
|
count: 2
|
||||||
|
@ -22,7 +22,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
|||||||
private SerializerInterface $serializer;
|
private SerializerInterface $serializer;
|
||||||
private AccompanyingPeriodWorkRepository $workRepository;
|
private AccompanyingPeriodWorkRepository $workRepository;
|
||||||
private PaginatorFactory $paginator;
|
private PaginatorFactory $paginator;
|
||||||
protected LoggerInterface $logger;
|
private LoggerInterface $chillLogger;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatorInterface $trans,
|
TranslatorInterface $trans,
|
||||||
@ -35,7 +35,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
|||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
$this->workRepository = $workRepository;
|
$this->workRepository = $workRepository;
|
||||||
$this->paginator = $paginator;
|
$this->paginator = $paginator;
|
||||||
$this->logger = $logger;
|
$this->chillLogger = $chillLogger;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -133,7 +133,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isValid()) {
|
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(),
|
'by_user' => $this->getUser()->getUsername(),
|
||||||
'work_id' => $work->getId(),
|
'work_id' => $work->getId(),
|
||||||
'accompanying_period_id' => $work->getAccompanyingPeriod()->getId()
|
'accompanying_period_id' => $work->getAccompanyingPeriod()->getId()
|
||||||
@ -162,6 +162,7 @@ class AccompanyingCourseWorkController extends AbstractController
|
|||||||
|
|
||||||
private function createDeleteForm(int $id): Form
|
private function createDeleteForm(int $id): Form
|
||||||
{
|
{
|
||||||
|
$params = [];
|
||||||
$params['id'] = $id;
|
$params['id'] = $id;
|
||||||
|
|
||||||
return $this->createFormBuilder()
|
return $this->createFormBuilder()
|
||||||
|
@ -1137,14 +1137,15 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
|
|
||||||
public function getGroupSequence()
|
public function getGroupSequence()
|
||||||
{
|
{
|
||||||
if($this->getStep() == self::STEP_DRAFT)
|
if ($this->getStep() == self::STEP_DRAFT)
|
||||||
{
|
{
|
||||||
return [[self::STEP_DRAFT]];
|
return [[self::STEP_DRAFT]];
|
||||||
}
|
} elseif ($this->getStep() == self::STEP_CONFIRMED)
|
||||||
|
|
||||||
if($this->getStep() == self::STEP_CONFIRMED)
|
|
||||||
{
|
{
|
||||||
return [[self::STEP_DRAFT, 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());
|
$overlaps = new DateRangeCovering(self::MAX_PARTICIPATION, $participations[0]->getStartDate()->getTimezone());
|
||||||
|
$participationList = [];
|
||||||
|
|
||||||
foreach ($participations as $participation) {
|
foreach ($participations as $participation) {
|
||||||
|
|
||||||
@ -38,12 +39,12 @@ class ParticipationOverlapValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
$personId = $participation->getPerson()->getId();
|
$personId = $participation->getPerson()->getId();
|
||||||
|
|
||||||
$particpationList[$personId][] = $participation;
|
$participationList[$personId][] = $participation;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($particpationList as $group) {
|
foreach ($participationList as $group) {
|
||||||
if (count($group) > 1) {
|
if (count($group) > 1) {
|
||||||
foreach ($group as $p) {
|
foreach ($group as $p) {
|
||||||
$overlaps->add($p->getStartDate(), $p->getEndDate(), $p->getId());
|
$overlaps->add($p->getStartDate(), $p->getEndDate(), $p->getId());
|
||||||
@ -69,4 +70,4 @@ class ParticipationOverlapValidator extends ConstraintValidator
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user