Completed
Push — master ( 76d231...c2873c )
by Jeroen
18:44 queued 09:27
created

autoloader.php ➔ _elgg_config()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Elgg autoloader
4
 * Facilities for class/interface/trait autoloading.
5
 *
6
 * @package    Elgg.Core
7
 * @subpackage Autoloader
8
 */
9
10
/**
11
 * Get the global service provider
12
 *
13
 * @param \Elgg\Di\ServiceProvider $services Elgg service provider. This must be set by the application.
14
 * @return \Elgg\Di\ServiceProvider
15
 * @access private
16
 */
17
function _elgg_services(\Elgg\Di\ServiceProvider $services = null) {
18 720
	static $inst;
19 720
	if ($services !== null) {
20 196
		$inst = $services;
21
	}
22 720
	return $inst;
23
}
24
25
/**
26
 * Get the Elgg config service
27
 *
28
 * @return \Elgg\Config
29
 * @access private
30
 */
31
function _elgg_config() {
32
	return _elgg_services()->config;
33
}
34
35
/**
36
 * Delete the autoload system cache
37
 *
38
 * @access private
39
 */
40
function _elgg_delete_autoload_cache() {
41
	_elgg_services()->autoloadManager->deleteCache();
42
}
43
44
return function(\Elgg\EventsService $events, \Elgg\HooksRegistrationService $hooks) {
0 ignored issues
show
Unused Code introduced by
The parameter $hooks 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...
45
	$events->registerHandler('upgrade', 'all', '_elgg_delete_autoload_cache', 600);
46
};
47