Completed
Push — master ( fc4fd5...d12ea0 )
by Jacob
03:43
created
utility/Debugger.class.inc.php 4 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?
2 2
 
3
-use Particletree\Pqp\Console;
3
+use Particletree\Pqp\Console;
4 4
 use Particletree\Pqp\PhpQuickProfiler;
5 5
 
6 6
 final class Debugger
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@
 block discarded – undo
81 81
 
82 82
 	public static function display()
83 83
 	{
84
-    if ($_COOKIE['debugger'] == 'display' && self::instance()->display) {
84
+	if ($_COOKIE['debugger'] == 'display' && self::instance()->display) {
85 85
 			self::instance()->profiler->display();
86
-    }
86
+	}
87 87
 	}
88 88
 
89 89
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 	private static $UNKNOWN_ERROR_FILE		= 'Unknown File';
10 10
 	private static $UNKNOWN_ERROR_LINE		= 'Unknown Line';
11
-	private static $UNKNOWN_ERROR_CONTEXT	= 'Unknown Context';
11
+	private static $UNKNOWN_ERROR_CONTEXT = 'Unknown Context';
12 12
 
13 13
 	private $profiler;
14 14
 	private $display = true;
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 	public static function instance()
25 25
 	{
26
-		if(!isset(self::$instance))
26
+		if (!isset(self::$instance))
27 27
 			self::$instance = new Debugger();
28 28
 		return self::$instance;
29 29
 	}
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 
52 52
 	public static function internal_error($code, $string, $file = null, $line = null, $context = null)
53 53
 	{
54
-		if($file == null)
54
+		if ($file == null)
55 55
 			$file = self::$UNKNOWN_ERROR_FILE;
56
-		if($line == null)
56
+		if ($line == null)
57 57
 			$line = self::$UNKNOWN_ERROR_LINE;
58
-		if($context == null)
58
+		if ($context == null)
59 59
 			$context = self::$UNKNOWN_ERROR_CONTEXT;
60 60
 		
61 61
 		self::instance()->console->logError(new Exception($string), "{$string}... TYPE: {$code}");
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	{
68 68
 		$error = error_get_last();
69 69
 		
70
-		if(isset($error))
70
+		if (isset($error))
71 71
 			self::internal_error($error['type'], $error['message'], $error['file'], $error['line']);
72 72
 		
73 73
 		self::display();
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  discard block
 block discarded – undo
23 23
 
24 24
 	public static function instance()
25 25
 	{
26
-		if(!isset(self::$instance))
27
-			self::$instance = new Debugger();
26
+		if(!isset(self::$instance)) {
27
+					self::$instance = new Debugger();
28
+		}
28 29
 		return self::$instance;
29 30
 	}
30 31
 
@@ -51,12 +52,15 @@  discard block
 block discarded – undo
51 52
 
52 53
 	public static function internal_error($code, $string, $file = null, $line = null, $context = null)
53 54
 	{
54
-		if($file == null)
55
-			$file = self::$UNKNOWN_ERROR_FILE;
56
-		if($line == null)
57
-			$line = self::$UNKNOWN_ERROR_LINE;
58
-		if($context == null)
59
-			$context = self::$UNKNOWN_ERROR_CONTEXT;
55
+		if($file == null) {
56
+					$file = self::$UNKNOWN_ERROR_FILE;
57
+		}
58
+		if($line == null) {
59
+					$line = self::$UNKNOWN_ERROR_LINE;
60
+		}
61
+		if($context == null) {
62
+					$context = self::$UNKNOWN_ERROR_CONTEXT;
63
+		}
60 64
 		
61 65
 		self::instance()->console->logError(new Exception($string), "{$string}... TYPE: {$code}");
62 66
 		
@@ -67,8 +71,9 @@  discard block
 block discarded – undo
67 71
 	{
68 72
 		$error = error_get_last();
69 73
 		
70
-		if(isset($error))
71
-			self::internal_error($error['type'], $error['message'], $error['file'], $error['line']);
74
+		if(isset($error)) {
75
+					self::internal_error($error['type'], $error['message'], $error['file'], $error['line']);
76
+		}
72 77
 		
73 78
 		self::display();
74 79
 		return true;
Please login to merge, or discard this patch.