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

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

Labels
Severity
1
<?php
2
/**
3
 * Show a listing of all users who are invited to join this group
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 (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
$content = elgg_list_relationships([
21
	'relationship' => 'invited',
22
	'relationship_guid' => $group->guid,
23
	'no_results' => true,
24
]);
25
26
// draw page
27
echo elgg_view_page(elgg_echo('groups:invitedmembers'), [
28
	'content' => $content,
29
	'filter_id' => 'groups/members',
30
	'filter_value' => 'membership_invites',
31
	'filter_entity' => $group,
32
	'filter_sorting' => false,
33
]);
34