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

views/default/river/object/thewire/create.php (1 issue)

Checks if the types of the passed arguments in a function/method call are compatible.

Bug Minor
1
<?php
2
/**
3
 * File river view.
4
 */
5
6
$item = elgg_extract('item', $vars);
7
if (!$item instanceof ElggRiverItem) {
8
	return;
9
}
10
11
$object = $item->getObjectEntity();
12
$vars['message'] = thewire_filter($object->description);
0 ignored issues
show
It seems like $object->description can also be of type array; however, parameter $text of thewire_filter() 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

12
$vars['message'] = thewire_filter(/** @scrutinizer ignore-type */ $object->description);
Loading history...
13
14
$subject = $item->getSubjectEntity();
15
$subject_link = elgg_view('output/url', [
16
	'href' => $subject->getURL(),
17
	'text' => $subject->name,
18
	'class' => 'elgg-river-subject',
19
	'is_trusted' => true,
20
]);
21
22
$object_link = elgg_view('output/url', [
23
	'href' => "thewire/owner/$subject->username",
24
	'text' => elgg_echo('thewire:wire'),
25
	'class' => 'elgg-river-object',
26
	'is_trusted' => true,
27
]);
28
29
$vars['summary'] = elgg_echo('river:object:thewire:create', [$subject_link, $object_link]);
30
31
echo elgg_view('river/elements/layout', $vars);
32