mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -21,34 +21,17 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final class MenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
private Security $security;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
Security $security,
|
||||
TranslatorInterface $translator
|
||||
) {
|
||||
$this->security = $security;
|
||||
$this->translator = $translator;
|
||||
public function __construct(private Security $security, private TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
switch ($menuId) {
|
||||
case 'accompanyingCourse':
|
||||
$this->buildMenuAccompanyingCourse($menu, $parameters);
|
||||
|
||||
break;
|
||||
|
||||
case 'person':
|
||||
$this->buildMenuPerson($menu, $parameters);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new LogicException("this menuid {$menuId} is not implemented");
|
||||
}
|
||||
match ($menuId) {
|
||||
'accompanyingCourse' => $this->buildMenuAccompanyingCourse($menu, $parameters),
|
||||
'person' => $this->buildMenuPerson($menu, $parameters),
|
||||
default => throw new LogicException("this menuid {$menuId} is not implemented"),
|
||||
};
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
|
Reference in New Issue
Block a user