Passed
Push — master ( 5063d9...a1994b )
by Jeroen
22:08
created

Includer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
dl 0
loc 32
ccs 2
cts 6
cp 0.3333
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A includeFile() 0 3 1
A requireFile() 0 3 1
A requireFileOnce() 0 3 1
1
<?php
2
namespace Elgg;
3
4
/**
5
 * Allow executing scripts without $this context or local vars
6
 *
7
 * @access private
8
 */
9
final class Includer {
10
11
	/**
12
	 * Include a file with as little context as possible
13
	 *
14
	 * @param string $file File to include
15
	 * @return mixed
16
	 */
17 25
	static public function includeFile($file) {
18 25
		return include $file;
19
	}
20
21
	/**
22
	 * Require a file with as little context as possible
23
	 *
24
	 * @param string $file File to require
25
	 * @return mixed
26
	 */
27
	static public function requireFile($file) {
28
		return require $file;
29
	}
30
31
	/**
32
	 * Require a file once with as little context as possible
33
	 *
34
	 * @param string $file File to require
35
	 * @return mixed
36
	 */
37
	static public function requireFileOnce($file) {
38
		return require_once $file;
39
	}
40
}
41