mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -28,12 +28,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UrgencyAggregator implements AggregatorInterface
|
||||
{
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
TranslatorInterface $translator
|
||||
) {
|
||||
$this->translator = $translator;
|
||||
public function __construct(private TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function addRole(): ?string
|
||||
@@ -64,16 +60,11 @@ class UrgencyAggregator implements AggregatorInterface
|
||||
return 'Urgency';
|
||||
}
|
||||
|
||||
switch ($value) {
|
||||
case true:
|
||||
return $this->translator->trans('is urgent');
|
||||
|
||||
case false:
|
||||
return $this->translator->trans('is not urgent');
|
||||
|
||||
default:
|
||||
throw new LogicException(sprintf('The value %s is not valid', $value));
|
||||
}
|
||||
return match ($value) {
|
||||
true => $this->translator->trans('is urgent'),
|
||||
false => $this->translator->trans('is not urgent'),
|
||||
default => throw new LogicException(sprintf('The value %s is not valid', $value)),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user