mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 10:29:42 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -17,10 +17,6 @@ use Symfony\Component\Routing\RouteCollection;
|
||||
use Symfony\Component\Routing\RouterInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function array_merge;
|
||||
use function array_values;
|
||||
|
||||
/**
|
||||
* This class permit to build menu from the routing information
|
||||
* stored in each bundle.
|
||||
@@ -53,7 +49,7 @@ class MenuComposer
|
||||
'order' => $order,
|
||||
])
|
||||
->setExtras([
|
||||
//'icon' => $route['icon'],
|
||||
// 'icon' => $route['icon'],
|
||||
// sf4 check: commented to avoid error: `An exception has been thrown during the rendering of a template ("Notice: Undefined index: icon").`
|
||||
'order' => $order,
|
||||
]);
|
||||
@@ -76,7 +72,7 @@ class MenuComposer
|
||||
* The array is aimed to build route with MenuTwig.
|
||||
*
|
||||
* @param string $menuId
|
||||
* @param array $parameters see https://redmine.champs-libres.coop/issues/179
|
||||
* @param array $parameters see https://redmine.champs-libres.coop/issues/179
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -87,13 +83,13 @@ class MenuComposer
|
||||
|
||||
foreach ($routeCollection->all() as $routeKey => $route) {
|
||||
if ($route->hasOption('menus')) {
|
||||
if (array_key_exists($menuId, $route->getOption('menus'))) {
|
||||
if (\array_key_exists($menuId, $route->getOption('menus'))) {
|
||||
$route = $route->getOption('menus')[$menuId];
|
||||
|
||||
$route['key'] = $routeKey;
|
||||
|
||||
$order = $this->resolveOrder($routes, $route['order']);
|
||||
//we do not want to duplicate order information
|
||||
// we do not want to duplicate order information
|
||||
unset($route['order']);
|
||||
$routes[$order] = $route;
|
||||
}
|
||||
@@ -116,7 +112,7 @@ class MenuComposer
|
||||
*/
|
||||
public function hasLocalMenuBuilder($menuId): bool
|
||||
{
|
||||
return array_key_exists($menuId, $this->localMenuBuilders);
|
||||
return \array_key_exists($menuId, $this->localMenuBuilders);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,7 +143,7 @@ class MenuComposer
|
||||
|
||||
ksort($ordered);
|
||||
|
||||
$menus = array_merge(array_values($ordered), $unordered);
|
||||
$menus = \array_merge(\array_values($ordered), $unordered);
|
||||
$menu->reorderChildren($menus);
|
||||
}
|
||||
|
||||
@@ -157,7 +153,7 @@ class MenuComposer
|
||||
* first next order available.
|
||||
*
|
||||
* @param array $routes the routes previously added
|
||||
* @param int $order
|
||||
* @param int $order
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
|
Reference in New Issue
Block a user