mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-05 21:09:43 +00:00
Rector changes and immplementations of required methods
This commit is contained in:
@@ -27,7 +27,7 @@ class ChillRoutesLoader extends Loader
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function load($resource, $type = null)
|
||||
public function load(mixed $resource, $type = null): mixed
|
||||
{
|
||||
$collection = new RouteCollection();
|
||||
|
||||
@@ -40,7 +40,7 @@ class ChillRoutesLoader extends Loader
|
||||
return $collection;
|
||||
}
|
||||
|
||||
public function supports($resource, $type = null)
|
||||
public function supports($resource, $type = null): bool
|
||||
{
|
||||
return 'chill_routes' === $type;
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ class AdminLanguageMenuBuilder implements LocalMenuBuilderInterface
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
// all the entries below must have ROLE_ADMIN permissions
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
|
@@ -27,7 +27,7 @@ class AdminLocationMenuBuilder implements LocalMenuBuilderInterface
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
// all the entries below must have ROLE_ADMIN permissions
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
|
@@ -19,7 +19,7 @@ class AdminNewsMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private readonly AuthorizationCheckerInterface $authorizationChecker) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
|
@@ -30,7 +30,7 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
// all the entries below must have ROLE_ADMIN permissions
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
|
@@ -28,7 +28,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
*/
|
||||
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator, protected ParameterBagInterface $parameterBag) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||
{
|
||||
$menu->addChild($this->translator->trans('Homepage'), [
|
||||
'route' => 'chill_main_homepage',
|
||||
|
@@ -24,7 +24,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private readonly NotificationByUserCounter $notificationByUserCounter, private readonly WorkflowByUserCounter $workflowByUserCounter, private readonly Security $security, private readonly TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private readonly RequestStack $requestStack) {}
|
||||
|
||||
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters)
|
||||
public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters): void
|
||||
{
|
||||
$user = $this->security->getUser();
|
||||
|
||||
|
@@ -31,7 +31,7 @@ class MenuComposer
|
||||
|
||||
public function __construct(private readonly RouterInterface $router, private readonly FactoryInterface $menuFactory, private readonly TranslatorInterface $translator) {}
|
||||
|
||||
public function addLocalMenuBuilder(LocalMenuBuilderInterface $menuBuilder, $menuId)
|
||||
public function addLocalMenuBuilder(LocalMenuBuilderInterface $menuBuilder, $menuId): void
|
||||
{
|
||||
$this->localMenuBuilders[$menuId][] = $menuBuilder;
|
||||
}
|
||||
@@ -121,12 +121,12 @@ class MenuComposer
|
||||
* available as a service (RouterInterface is provided as a service and
|
||||
* added to this class as paramater in __construct).
|
||||
*/
|
||||
public function setRouteCollection(RouteCollection $routeCollection)
|
||||
public function setRouteCollection(RouteCollection $routeCollection): void
|
||||
{
|
||||
$this->routeCollection = $routeCollection;
|
||||
}
|
||||
|
||||
private function reorderMenu(ItemInterface $menu)
|
||||
private function reorderMenu(ItemInterface $menu): void
|
||||
{
|
||||
$ordered = [];
|
||||
$unordered = [];
|
||||
|
@@ -46,7 +46,7 @@ class MenuTwig extends AbstractExtension
|
||||
* @param string $menuId
|
||||
* @param mixed[] $params
|
||||
*/
|
||||
public function chillMenu(Environment $env, $menuId, array $params = [])
|
||||
public function chillMenu(Environment $env, $menuId, array $params = []): string
|
||||
{
|
||||
$resolvedParams = array_merge($this->defaultParams, $params);
|
||||
|
||||
|
Reference in New Issue
Block a user