From 4987c523c595d40bd40eb620db53062dc9d16d32 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sun, 6 Dec 2020 01:23:54 +0100 Subject: [PATCH] Fix array shapes with groups --- src/Admin/Pool.php | 30 ++++++++++++++++++++++++--- src/Twig/Extension/GroupExtension.php | 13 +++++++----- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/Admin/Pool.php b/src/Admin/Pool.php index 8e3a66984bd..54abe7f67e5 100644 --- a/src/Admin/Pool.php +++ b/src/Admin/Pool.php @@ -38,6 +38,23 @@ class Pool /** * @var array + * @phpstan-var array, + * route?: string, + * router_absolute: bool, + * route_params: array + * }>, + * keep_open: bool, + * on_top: bool, + * roles: list + * }> */ protected $adminGroups = []; @@ -136,9 +153,6 @@ public function __construct( $this->propertyAccessor = $propertyAccessor; } - /** - * @return array> - */ public function getGroups() { $groups = $this->adminGroups; @@ -166,6 +180,16 @@ public function hasGroup($group) /** * @return array + * @phpstan-return array, + * keep_open: bool, + * on_top: bool, + * roles: list + * }> */ public function getDashboardGroups() { diff --git a/src/Twig/Extension/GroupExtension.php b/src/Twig/Extension/GroupExtension.php index f2dfbb360a8..bac816e3045 100644 --- a/src/Twig/Extension/GroupExtension.php +++ b/src/Twig/Extension/GroupExtension.php @@ -44,13 +44,16 @@ public function getFunctions(): array } /** - * @phpstan-return array{array{ - * roles: list, - * icon: string, + * @phpstan-return array + * }> */ public function getDashboardGroupsWithCreatableAdmins(): array {