mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: do not loop on possible choices to display action
This commit is contained in:
parent
f5997e39cd
commit
ca67170ad3
@ -74,15 +74,13 @@ class EmergencyFilter implements FilterInterface
|
|||||||
|
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
foreach (self::CHOICES as $k => $v) {
|
return [
|
||||||
if ($v === $data['accepted_emergency']) {
|
'Filtered by emergency: only %emergency%', [
|
||||||
$choice = $k;
|
'%emergency%' => $this->translator->trans(
|
||||||
}
|
$data['accepted_emergency'] ? 'is emergency' : 'is not emergency'
|
||||||
}
|
),
|
||||||
|
],
|
||||||
return ['Filtered activity by emergency: only %emergency%', [
|
];
|
||||||
'%emergency%' => $this->translator->trans($choice),
|
|
||||||
]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user