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

engine/lib/sites.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 sites
4
 * Functions to manage multiple or single sites in an Elgg install
5
 *
6
 * @package Elgg.Core
7
 * @subpackage DataModel.Site
8
 */
9
10
/**
11
 * Get an \ElggSite entity (default is current site)
12
 *
13
 * @return \ElggSite|false
14
 * @since 1.8.0
15
 */
16
function elgg_get_site_entity() {
17 1
	return elgg_get_config('site');
18
}
19
20
/**
21
 * Return the site specific details of a site by a row.
22
 *
23
 * @param int $guid The site GUID
24
 *
25
 * @return mixed
26
 * @access private
27
 */
28
function get_site_entity_as_row($guid) {
29
	global $CONFIG;
30
31
	$guid = (int) $guid;
32
	return get_data_row("SELECT * FROM {$CONFIG->dbprefix}sites_entity WHERE guid = $guid");
33
}
34
35
/**
36
 * Unit tests for sites
37
 *
38
 * @param string $hook   unit_test
39
 * @param string $type   system
40
 * @param mixed  $value  Array of tests
41
 * @param mixed  $params Params
42
 *
43
 * @return array
44
 * @access private
45
 */
46
function _elgg_sites_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...
47
	global $CONFIG;
48
	$value[] = "{$CONFIG->path}engine/tests/ElggSiteTest.php";
49
	return $value;
50
}
51
52
return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
53
	$hooks->registerHandler('unit_test', 'system', '_elgg_sites_test');
54
};
55