Passed
Push — 5.x ( 39b1e8...2ac3d7 )
by Jeroen
15:45 queued 13s
created

groups/views/default/resources/groups/members.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Show a list of all group members
4
 */
5
6
$group = elgg_get_page_owner_entity();
7
8
elgg_push_entity_breadcrumbs($group);
1 ignored issue
show
It seems like $group can also be of type null; however, parameter $entity of elgg_push_entity_breadcrumbs() does only seem to accept ElggEntity, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

8
elgg_push_entity_breadcrumbs(/** @scrutinizer ignore-type */ $group);
Loading history...
9
10
if ($group->canEdit() && elgg_is_active_plugin('friends')) {
11
	elgg_register_menu_item('title', [
12
		'name' => 'groups:invite',
13
		'icon' => 'user-plus',
14
		'href' => elgg_generate_entity_url($group, 'invite'),
15
		'text' => elgg_echo('groups:invite'),
16
		'link_class' => 'elgg-button elgg-button-action',
17
	]);
18
}
19
20
// draw page
21
echo elgg_view_page(elgg_echo('groups:members:title', [$group->getDisplayName()]), [
22
	'content' => elgg_list_relationships([
23
		'type' => 'user',
24
		'relationship' => 'member',
25
		'relationship_guid' => $group->guid,
26
		'inverse_relationship' => true,
27
		'sort_by' => get_input('sort_by', [
28
			'property' => 'name',
29
			'property_type' => 'metadata',
30
			'direction' => 'asc',
31
		]),
32
	]),
33
	'filter_id' => 'groups/members',
34
	'filter_value' => 'members',
35
	'filter_entity' => $group,
36
]);
37