Completed
Push — master ( 07c22d...01f91a )
by Jacob
02:50
created
src/PhpQuickProfiler.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -153,19 +153,19 @@
 block discarded – undo
153 153
 	}
154 154
 	
155 155
 	public function getReadableFileSize($size, $retstring = null) {
156
-        	// adapted from code at http://aidanlister.com/repos/v/function.size_readable.php
157
-	       $sizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
156
+			// adapted from code at http://aidanlister.com/repos/v/function.size_readable.php
157
+		   $sizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
158 158
 
159
-	       if ($retstring === null) { $retstring = '%01.2f %s'; }
159
+		   if ($retstring === null) { $retstring = '%01.2f %s'; }
160 160
 
161 161
 		$lastsizestring = end($sizes);
162 162
 
163 163
 		foreach ($sizes as $sizestring) {
164
-	       	if ($size < 1024) { break; }
165
-	           if ($sizestring != $lastsizestring) { $size /= 1024; }
166
-	       }
167
-	       if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; } // Bytes aren't normally fractional
168
-	       return sprintf($retstring, $size, $sizestring);
164
+		   	if ($size < 1024) { break; }
165
+			   if ($sizestring != $lastsizestring) { $size /= 1024; }
166
+		   }
167
+		   if ($sizestring == $sizes[0]) { $retstring = '%01d %s'; } // Bytes aren't normally fractional
168
+		   return sprintf($retstring, $size, $sizestring);
169 169
 	}
170 170
 	
171 171
 	public function getReadableTime($time) {
Please login to merge, or discard this patch.
src/Console.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -14,96 +14,96 @@
 block discarded – undo
14 14
 class Console
15 15
 {
16 16
 
17
-    /** @var  array */
18
-    protected $log = array();
17
+	/** @var  array */
18
+	protected $log = array();
19 19
 
20
-    /** @var  array */
21
-    protected $memory = array();
20
+	/** @var  array */
21
+	protected $memory = array();
22 22
 
23
-    /** @var  array */
24
-    protected $error = array();
23
+	/** @var  array */
24
+	protected $error = array();
25 25
 
26
-    /** @var  array */
27
-    protected $speed = array();
26
+	/** @var  array */
27
+	protected $speed = array();
28 28
 
29
-    /**
30
-     * Logs data to the console
31
-     * Accepts any data type
32
-     *
33
-     * @param mixed $data
34
-     */
35
-    public function log($data)
36
-    {
37
-        array_push($this->logs, $data);
38
-    }
29
+	/**
30
+	 * Logs data to the console
31
+	 * Accepts any data type
32
+	 *
33
+	 * @param mixed $data
34
+	 */
35
+	public function log($data)
36
+	{
37
+		array_push($this->logs, $data);
38
+	}
39 39
 
40
-    /**
41
-     * Logs memory usage of a variable
42
-     * If no parameter is passed in, logs current memory usage
43
-     *
44
-     * @param mixed $object
45
-     * @param string $name
46
-     */
47
-    public function logMemory($object = null, $name = '')
48
-    {
49
-        if (!is_null($object)) {
50
-            $memory = strlen(serialize($object));
51
-        } else {
52
-            $memory = memory_get_usage();
53
-            $name = 'PHP';
54
-        }
40
+	/**
41
+	 * Logs memory usage of a variable
42
+	 * If no parameter is passed in, logs current memory usage
43
+	 *
44
+	 * @param mixed $object
45
+	 * @param string $name
46
+	 */
47
+	public function logMemory($object = null, $name = '')
48
+	{
49
+		if (!is_null($object)) {
50
+			$memory = strlen(serialize($object));
51
+		} else {
52
+			$memory = memory_get_usage();
53
+			$name = 'PHP';
54
+		}
55 55
 
56
-        array_push($this->memory, array(
57
-            'data' => $memory,
58
-            'name' => $name,
59
-            'type' => gettype($object)
60
-        ));
61
-    }
56
+		array_push($this->memory, array(
57
+			'data' => $memory,
58
+			'name' => $name,
59
+			'type' => gettype($object)
60
+		));
61
+	}
62 62
 
63
-    /**
64
-     * Logs exception with optional message override
65
-     *
66
-     * @param Exception $exception
67
-     * @param string    $message
68
-     */
69
-    public function logError(Exception $exception, $message = '')
70
-    {
71
-        if (empty($message)) {
72
-            $message = $exception->getMessage();
73
-        }
63
+	/**
64
+	 * Logs exception with optional message override
65
+	 *
66
+	 * @param Exception $exception
67
+	 * @param string    $message
68
+	 */
69
+	public function logError(Exception $exception, $message = '')
70
+	{
71
+		if (empty($message)) {
72
+			$message = $exception->getMessage();
73
+		}
74 74
 
75
-        array_push($this->error, array(
76
-            'data' => $message,
77
-            'file' => $exception->getFile(),
78
-            'line' => $exception->getLine(),
79
-        ));
80
-    }
75
+		array_push($this->error, array(
76
+			'data' => $message,
77
+			'file' => $exception->getFile(),
78
+			'line' => $exception->getLine(),
79
+		));
80
+	}
81 81
 
82
-    /**
83
-     * Logs current time with optional message
84
-     *
85
-     * @param string $name
86
-     */
87
-    public function logSpeed($name = 'Point in Time')
88
-    {
89
-        array_push($this->speed, array(
90
-            'data' => microtime(true),
91
-            'name' => $name,
92
-        ));
93
-    }
82
+	/**
83
+	 * Logs current time with optional message
84
+	 *
85
+	 * @param string $name
86
+	 */
87
+	public function logSpeed($name = 'Point in Time')
88
+	{
89
+		array_push($this->speed, array(
90
+			'data' => microtime(true),
91
+			'name' => $name,
92
+		));
93
+	}
94 94
 
95
-    /**
96
-     * Returns the collected logs
97
-     *
98
-     * @returns array
99
-     */
100
-    public function getLogs()
101
-    {
102
-        return array(
103
-            'log'    => $this->log,
104
-            'memory' => $this->memory,
105
-            'error'  => $this->error,
106
-            'speed'  => $this->speed
107
-        );
108
-    }
95
+	/**
96
+	 * Returns the collected logs
97
+	 *
98
+	 * @returns array
99
+	 */
100
+	public function getLogs()
101
+	{
102
+		return array(
103
+			'log'    => $this->log,
104
+			'memory' => $this->memory,
105
+			'error'  => $this->error,
106
+			'speed'  => $this->speed
107
+		);
108
+	}
109 109
 }
Please login to merge, or discard this patch.