Test Failed
Push — master ( 8c47c2...3acf9f )
by Steve
12:37
created

engine/lib/objects.php (3 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Elgg objects
4
 * Functions to manage multiple or single objects in an Elgg install
5
 *
6
 * @package Elgg
7
 * @subpackage Core
8
 */
9
10
/**
11
 * Return the object specific details of a object by a row.
12
 *
13
 * @param int $guid The guid to retrieve
14
 *
15
 * @return bool
16
 * @access private
17
 */
18
function get_object_entity_as_row($guid) {
19
	$dbprefix = elgg_get_config('dbprefix');
20
	$sql = "SELECT * FROM {$dbprefix}objects_entity
21
		WHERE guid = :guid";
22
	$params = [
23
		':guid' => (int) $guid,
24
	];
25
	return _elgg_services()->db->getDataRow($sql, null, $params);
26
}
27
28
/**
29
 * Runs unit tests for \ElggObject
30
 *
31
 * @param string $hook   unit_test
32
 * @param string $type   system
33
 * @param mixed  $value  Array of tests
34
 * @param mixed  $params Params
35
 *
36
 * @return array
37
 * @access private
38
 */
39
function _elgg_objects_test($hook, $type, $value, $params) {
0 ignored issues
show
The parameter $hook is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
	global $CONFIG;
41
	$value[] = "{$CONFIG->path}engine/tests/ElggObjectTest.php";
42
	return $value;
43
}
44
45
return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
46
	$hooks->registerHandler('unit_test', 'system', '_elgg_objects_test');
47
};
48