Completed
Pull Request — master (#526)
by Michael
16:45 queued 06:57
created

DebugHelper   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 1
Metric Value
eloc 15
dl 0
loc 28
ccs 0
cts 19
cp 0
rs 10
c 1
b 1
f 1
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A getBacktrace() 0 26 5
1
<?php
2
3
/**
4
 * DebugHelper short summary.
5
 *
6
 * DebugHelper description.
7
 *
8
 * @version 1.0
9
 * @author stwalkerster
10
 */
11
class DebugHelper
12
{
13
	public static function getBacktrace()
14
	{
15
		$backtrace = debug_backtrace();
16
        
17
		$output = "";
18
        
19
		$count = 0;
20
		foreach ($backtrace as $line) {
21
			if ($count == 0) {
22
				$count++;
23
				continue;
24
			}
25
            
26
			$output .= "#{$count}: ";
27
            
28
			if (isset($line['type']) && $line['type'] != "") {
29
				$output .= $line['class'] . $line['type'];
30
			}
31
            
32
			$output .= $line['function'] . "(...)";
33
			$output .= " [{$line['file']}#{$line['line']}\r\n";
34
            
35
			$count++;
36
		}
37
        
38
		return $output;
39
	}
40
}
41