Remove usage of setParameters in various filters

This commit is contained in:
2023-10-16 14:28:04 +02:00
parent efcb903d10
commit 304bf4258b
12 changed files with 60 additions and 43 deletions

View File

@@ -22,13 +22,12 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class JobFilter implements FilterInterface
final readonly class JobFilter implements FilterInterface
{
private const PREFIX = 'cal_filter_job';
public function __construct(
protected TranslatorInterface $translator,
private readonly TranslatableStringHelper $translatableStringHelper
private TranslatableStringHelper $translatableStringHelper
) {}
public function addRole(): ?string
@@ -59,9 +58,10 @@ class JobFilter implements FilterInterface
)
)
->andWhere($qb->expr()->in("{$p}_history.job", ":{$p}_job"))
->setParameters([
"{$p}_job" => $data["job"],
]);
->setParameter(
"{$p}_job",
$data["job"]
);
}

View File

@@ -59,9 +59,10 @@ class ScopeFilter implements FilterInterface
)
)
->andWhere($qb->expr()->in("{$p}_history.scope", ":{$p}_scope"))
->setParameters([
"{$p}_scope" => $data["scope"],
]);
->setParameter(
"{$p}_scope",
$data["scope"]
);
}
public function applyOn(): string