DX: fix phpstan errors

This commit is contained in:
2023-02-07 23:03:37 +01:00
parent fa481fd795
commit f57555dab4
11 changed files with 41 additions and 41 deletions

View File

@@ -44,14 +44,7 @@ class UrgencyAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
$qb->addSelect('cal.urgent AS urgency_aggregator');
$groupBy = $qb->getDQLPart('groupBy');
if (!empty($groupBy)) {
$qb->addGroupBy('urgency_aggregator');
} else {
$qb->groupBy('urgency_aggregator');
}
$qb->addGroupBy('urgency_aggregator');
}
public function applyOn(): string

View File

@@ -49,23 +49,11 @@ class CalendarRangeFilter implements FilterInterface
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
dump($data);
if ($data['hasCalendarRange']) {
$clause = $qb->expr()->isNotNull('cal.calendarRange');
if (null !== $data['hasCalendarRange']) {
$qb->andWhere($qb->expr()->isNotNull('cal.calendarRange'));
} else {
$clause = $qb->expr()->isNull('cal.calendarRange');
$qb->andWhere($qb->expr()->isNull('cal.calendarRange'));
}
if ($where instanceof Andx) {
$where->add($clause);
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
}
public function applyOn(): string
@@ -87,6 +75,8 @@ class CalendarRangeFilter implements FilterInterface
public function describeAction($data, $format = 'string'): array
{
$choice = '';
foreach (self::CHOICES as $k => $v) {
if ($v === $data['hasCalendarRange']) {
$choice = $k;