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

default/admin/develop_tools/entity_explorer.php (1 issue)

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

Bug Minor
1
<?php
2
3
echo '<p>' . elgg_echo('developers:entity_explorer:help') . '</p>';
4
5
echo elgg_view_form('developers/entity_explorer', [
6
	'action' => 'admin/develop_tools/entity_explorer',
7
	'method' => 'GET',
8
	'disable_security' => true,
9
]);
10
11
$guid = get_input('guid');
12
if ($guid === null) {
13
	return;
14
}
15
16
$show_hidden = access_show_hidden_entities(true);
17
$entity = get_entity($guid);
0 ignored issues
show
It seems like $guid can also be of type string; however, parameter $guid of get_entity() does only seem to accept integer, 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

17
$entity = get_entity(/** @scrutinizer ignore-type */ $guid);
Loading history...
18
if (!$entity) {
19
	echo elgg_echo('notfound');
20
	return;
21
}
22
23
// Entity Information
24
echo elgg_view('admin/develop_tools/entity_explorer/attributes', ['entity' => $entity]);
25
26
// Metadata Information
27
echo elgg_view('admin/develop_tools/entity_explorer/metadata', ['entity' => $entity]);
28
29
// Relationship Information
30
echo elgg_view('admin/develop_tools/entity_explorer/relationships', ['entity' => $entity]);
31
32
// Private Settings Information
33
echo elgg_view('admin/develop_tools/entity_explorer/private_settings', ['entity' => $entity]);
34
35
access_show_hidden_entities($show_hidden);
36
37
echo elgg_view('output/url', [
38
	'text' => elgg_echo('developers:entity_explorer:delete_entity'),
39
	'href' => 'action/developers/entity_explorer_delete?guid=' . $entity->guid . '&type=entity&key=' . $entity->guid,
40
	'confirm' => true,
41
	'class' => 'elgg-button elgg-button-submit',
42
]);
43