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
|
|||
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 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.