Passed
Push — master ( c0a3a7...3b84a4 )
by Jeroen
58:51
created

views/default/resources/discussion/view.php (2 issues)

1
<?php
2
3
$guid = elgg_extract('guid', $vars);
4
5
elgg_register_rss_link();
6
7
elgg_entity_gatekeeper($guid, 'object', 'discussion');
8
9
$topic = get_entity($guid);
10
11
$container = $topic->getContainerEntity();
12
13
elgg_require_js('elgg/discussion');
14
15
elgg_set_page_owner_guid($container->getGUID());
16
17
elgg_group_gatekeeper();
18
19
if ($container instanceof ElggGroup) {
20
	$owner_url = "discussion/group/$container->guid";
21
} else {
22
	$owner_url = "discussion/owner/$container->guid";
23
}
24
25
elgg_push_breadcrumb($container->getDisplayName(), $owner_url);
26
elgg_push_breadcrumb($topic->title);
0 ignored issues
show
It seems like $topic->title can also be of type array; however, parameter $text of elgg_push_breadcrumb() does only seem to accept string, 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

26
elgg_push_breadcrumb(/** @scrutinizer ignore-type */ $topic->title);
Loading history...
27
28
$content = elgg_view_entity($topic, [
29
	'full_view' => true,
30
	'show_responses' => true,
31
]);
32
33
$params = [
34
	'content' => $content,
35
	'title' => $topic->title,
36
	'sidebar' => elgg_view('discussion/sidebar'),
37
	'filter' => '',
38
];
39
$body = elgg_view_layout('content', $params);
40
41
echo elgg_view_page($topic->title, $body);
0 ignored issues
show
It seems like $topic->title can also be of type array; however, parameter $title of elgg_view_page() does only seem to accept string, 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

41
echo elgg_view_page(/** @scrutinizer ignore-type */ $topic->title, $body);
Loading history...
42