From 78e619e9de1c1ea00ac878f8608bc7b7bf250fc0 Mon Sep 17 00:00:00 2001 From: El fazni said Date: Wed, 4 Jul 2018 18:08:22 +0200 Subject: [PATCH 1/2] We can update the generic @return array type hints to more precise data types like @return string[] and @return string[][]. This will help developers understand at a glance what they are dealing with. --- src/GroupTypeManagerInterface.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/GroupTypeManagerInterface.php b/src/GroupTypeManagerInterface.php index a6358c2ed..ffef1ff13 100644 --- a/src/GroupTypeManagerInterface.php +++ b/src/GroupTypeManagerInterface.php @@ -50,7 +50,7 @@ public function getGroupsForEntityType($entity_type_id); /** * Get all group bundles keyed by entity type. * - * @return array + * @return string[] * An associative array, keyed by entity type, each value an indexed array * of bundle IDs. */ @@ -63,7 +63,7 @@ public function getAllGroupBundles($entity_type = NULL); * information about the relations between groups and group content bundles * then use getGroupRelationMap() instead. * - * @return array + * @return string[] * An associative array of group content bundle IDs, keyed by entity type * ID. * @@ -81,7 +81,7 @@ public function getAllGroupContentBundles(); * @param string $entity_type_id * Entity type ID to filter the bundles by. * - * @return array + * @return string[] * An array of group content bundle IDs. * * @throws \InvalidArgumentException @@ -102,7 +102,7 @@ public function getAllGroupContentBundlesByEntityType($entity_type_id); * The bundle ID of the group content type for which to return associated * group bundle IDs. * - * @return array + * @return string[] * An array of group bundle IDs, keyed by group entity type ID. */ public function getGroupBundleIdsByGroupContentBundle($group_content_entity_type_id, $group_content_bundle_id); @@ -117,7 +117,7 @@ public function getGroupBundleIdsByGroupContentBundle($group_content_entity_type * The bundle ID of the group type for which to return associated group * content bundle IDs. * - * @return array + * @return string[] * An array of group content bundle IDs, keyed by group content entity type * ID. */ @@ -164,7 +164,7 @@ public function resetGroupRelationMap(); /** * Returns the group map. * - * @return array + * @return string[] * The group map. */ public function getGroupMap(); From 068aba296cec80d5b4de3da27dc760ea11fbf476 Mon Sep 17 00:00:00 2001 From: El fazni said Date: Thu, 5 Jul 2018 15:27:57 +0200 Subject: [PATCH 2/2] We can update the generic @return array type hints to more precise data types like @return string[] and @return string[][]. This will help developers understand at a glance what they are dealing with(Code review). --- src/GroupTypeManagerInterface.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/GroupTypeManagerInterface.php b/src/GroupTypeManagerInterface.php index ffef1ff13..b305bd442 100644 --- a/src/GroupTypeManagerInterface.php +++ b/src/GroupTypeManagerInterface.php @@ -50,7 +50,7 @@ public function getGroupsForEntityType($entity_type_id); /** * Get all group bundles keyed by entity type. * - * @return string[] + * @return string[][] * An associative array, keyed by entity type, each value an indexed array * of bundle IDs. */ @@ -63,7 +63,7 @@ public function getAllGroupBundles($entity_type = NULL); * information about the relations between groups and group content bundles * then use getGroupRelationMap() instead. * - * @return string[] + * @return string[][] * An associative array of group content bundle IDs, keyed by entity type * ID. * @@ -102,7 +102,7 @@ public function getAllGroupContentBundlesByEntityType($entity_type_id); * The bundle ID of the group content type for which to return associated * group bundle IDs. * - * @return string[] + * @return string[][] * An array of group bundle IDs, keyed by group entity type ID. */ public function getGroupBundleIdsByGroupContentBundle($group_content_entity_type_id, $group_content_bundle_id); @@ -117,7 +117,7 @@ public function getGroupBundleIdsByGroupContentBundle($group_content_entity_type * The bundle ID of the group type for which to return associated group * content bundle IDs. * - * @return string[] + * @return string[][] * An array of group content bundle IDs, keyed by group content entity type * ID. */ @@ -164,7 +164,7 @@ public function resetGroupRelationMap(); /** * Returns the group map. * - * @return string[] + * @return string[][] * The group map. */ public function getGroupMap();