Completed
Branch master (de1ee7)
by Jacob
05:01
created
utility/CronController.class.inc.php 1 patch
Braces   +14 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@  discard block
 block discarded – undo
26 26
 		{
27 27
 			//if(!$this->time_to_run($frequency))
28 28
 			//	continue;
29
-            if ($cron != 'TwitterCron') continue;
29
+            if ($cron != 'TwitterCron') {
30
+            	continue;
31
+            }
30 32
 			
31 33
 			Loader::load('utility', "cron/{$cron}");
32 34
 			$reflection = new ReflectionClass($cron);
@@ -51,18 +53,21 @@  discard block
 block discarded – undo
51 53
 		
52 54
 		foreach($time as $key => $value)
53 55
 		{
54
-			if($value == '*')
55
-				continue;
56
+			if($value == '*') {
57
+							continue;
58
+			}
56 59
 			if(stristr($value, '/'))
57 60
 			{
58 61
 				$value = substr($value, 2);
59
-				if($cur[$key] % $value == 0)
60
-					continue;
61
-				else
62
-					return;
62
+				if($cur[$key] % $value == 0) {
63
+									continue;
64
+				} else {
65
+									return;
66
+				}
67
+			}
68
+			if($cur[$key] == $value) {
69
+							continue;
63 70
 			}
64
-			if($cur[$key] == $value)
65
-				continue;
66 71
 			return;
67 72
 		}
68 73
 		return true;
Please login to merge, or discard this patch.
utility/Database.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@  discard block
 block discarded – undo
36 36
 		$mysqli = new mysqli($host, $username, $password);
37 37
 		
38 38
 		$has_connection_error = $mysqli->connect_error;
39
-		if(isset($has_connection_error))
40
-			$this->has_connection_error = true;
39
+		if(isset($has_connection_error)) {
40
+					$this->has_connection_error = true;
41
+		}
41 42
 		
42 43
 		return $mysqli;
43 44
 	}
@@ -67,8 +68,9 @@  discard block
 block discarded – undo
67 68
 		{
68 69
 			self::instance()->log_query($query, $start);
69 70
 			$array = array();
70
-			while($row = $result->fetch_object())
71
-				$array[] = $row;
71
+			while($row = $result->fetch_object()) {
72
+							$array[] = $row;
73
+			}
72 74
 			$result->close();
73 75
 			return $array;
74 76
 		}
@@ -79,8 +81,9 @@  discard block
 block discarded – undo
79 81
 	public static function selectRow($query)
80 82
 	{
81 83
 		$result = self::select($query);
82
-		if(is_array($result))
83
-			return array_pop($result);
84
+		if(is_array($result)) {
85
+					return array_pop($result);
86
+		}
84 87
 		return false;
85 88
 	}
86 89
 
@@ -99,8 +102,9 @@  discard block
 block discarded – undo
99 102
 	public static function lastInsertID()
100 103
 	{
101 104
 		$id = self::instance()->write_connection->insert_id;
102
-		if($id == 0)
103
-			return false;
105
+		if($id == 0) {
106
+					return false;
107
+		}
104 108
 		return $id;
105 109
 	}
106 110
 
Please login to merge, or discard this patch.
utility/Debugger.class.inc.php 1 patch
Braces   +18 added lines, -12 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("{$string}... TYPE: {$code}", $file, $line);
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;
@@ -81,8 +86,9 @@  discard block
 block discarded – undo
81 86
 
82 87
 	public static function display()
83 88
 	{
84
-		if(!Loader::isLive() && self::instance()->display)
85
-			self::instance()->profiler->display();
89
+		if(!Loader::isLive() && self::instance()->display) {
90
+					self::instance()->profiler->display();
91
+		}
86 92
 	}
87 93
 
88 94
 }
Please login to merge, or discard this patch.
utility/Environment.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,9 @@
 block discarded – undo
9 9
 
10 10
 	public function __construct($user_agent = null)
11 11
 	{
12
-		if(!isset($user_agent))
13
-			$user_agent = Request::getServer('HTTP_USER_AGENT');
12
+		if(!isset($user_agent)) {
13
+					$user_agent = Request::getServer('HTTP_USER_AGENT');
14
+		}
14 15
 		$this->user_agent = $user_agent;
15 16
 	}
16 17
 
Please login to merge, or discard this patch.
utility/Header.class.inc.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -186,8 +186,9 @@  discard block
 block discarded – undo
186 186
 
187 187
 	private static function send($array, $gzip = true)
188 188
 	{
189
-		if($gzip)
190
-			self::start_gzipping();
189
+		if($gzip) {
190
+					self::start_gzipping();
191
+		}
191 192
 		
192 193
 		foreach($array as $row)
193 194
 		{
@@ -197,15 +198,17 @@  discard block
 block discarded – undo
197 198
 
198 199
 	private static function get_date($timestamp = false)
199 200
 	{
200
-		if($timestamp == 0)
201
-			$timestamp = time();
201
+		if($timestamp == 0) {
202
+					$timestamp = time();
203
+		}
202 204
 		return gmdate('D, d M Y H:i:s \G\M\T', $timestamp);
203 205
 	}
204 206
 
205 207
 	private static function start_gzipping()
206 208
 	{
207
-		if(!ob_start('ob_gzhandler'))
208
-            ob_start();
209
+		if(!ob_start('ob_gzhandler')) {
210
+		            ob_start();
211
+		}
209 212
 	}
210 213
 
211 214
 }
212 215
\ No newline at end of file
Please login to merge, or discard this patch.
utility/ImageOld.class.inc.php 1 patch
Braces   +20 added lines, -16 removed lines patch added patch discarded remove patch
@@ -52,18 +52,20 @@  discard block
 block discarded – undo
52 52
 
53 53
 	public function setSize($size)
54 54
 	{
55
-		if($this->get_version() > 1)
56
-			$position = strrpos($this->file, '-v');
57
-		else
58
-			$position = strrpos($this->file, '.');
55
+		if($this->get_version() > 1) {
56
+					$position = strrpos($this->file, '-v');
57
+		} else {
58
+					$position = strrpos($this->file, '.');
59
+		}
59 60
 		
60 61
 		$this->file = substr($this->file, 0, $position) . '-s' . $size . substr($this->file, $position);
61 62
 	}
62 63
 
63 64
 	public function getDimensions()
64 65
 	{
65
-		if(!$this->isValid())
66
-			return false;
66
+		if(!$this->isValid()) {
67
+					return false;
68
+		}
67 69
 		$imageinfo = getimagesize($this->getInternalPath());
68 70
 		return array($imageinfo[0], $imageinfo[1]);
69 71
 	}
@@ -85,10 +87,11 @@  discard block
 block discarded – undo
85 87
 
86 88
 	private function get_image($image)
87 89
 	{
88
-		if(preg_match(self::$VERSION_PREG_MATCH, $image))
89
-			return preg_replace(self::$VERSION_PREG_MATCH, '', $image);
90
-		else
91
-			return $image;
90
+		if(preg_match(self::$VERSION_PREG_MATCH, $image)) {
91
+					return preg_replace(self::$VERSION_PREG_MATCH, '', $image);
92
+		} else {
93
+					return $image;
94
+		}
92 95
 	}
93 96
 
94 97
 	private function get_image_meta($image)
@@ -103,9 +106,9 @@  discard block
 block discarded – undo
103 106
 		{
104 107
 			$position = strrpos($image, '.');
105 108
 			return substr($image, 0, $position) . '-v' . $this->get_version() . substr($image, $position);
109
+		} else {
110
+					return $image;
106 111
 		}
107
-		else
108
-			return $image;
109 112
 	}
110 113
 
111 114
 	private $version;
@@ -118,10 +121,11 @@  discard block
 block discarded – undo
118 121
 			if(count($files) > 0)
119 122
 			{
120 123
 				preg_match(self::$VERSION_PREG_MATCH, $files[0], $matches);
121
-				if(count($matches))
122
-					$this->version = $matches[1];
123
-				else
124
-					$this->version = 1;
124
+				if(count($matches)) {
125
+									$this->version = $matches[1];
126
+				} else {
127
+									$this->version = 1;
128
+				}
125 129
 			}
126 130
 		}
127 131
 		return $this->version;
Please login to merge, or discard this patch.
utility/Loader.class.inc.php 1 patch
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -17,8 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 	public static function instance()
19 19
 	{
20
-		if(!isset(self::$instance))
21
-			self::$instance = new Loader();
20
+		if(!isset(self::$instance)) {
21
+					self::$instance = new Loader();
22
+		}
22 23
 		return self::$instance;
23 24
 	}
24 25
 
@@ -71,8 +72,9 @@  discard block
 block discarded – undo
71 72
 
72 73
 	public static function getImagePath($type, $file)
73 74
 	{
74
-		if($type == 'photo')
75
-			$type = 'photo/processed';
75
+		if($type == 'photo') {
76
+					$type = 'photo/processed';
77
+		}
76 78
 		
77 79
 		$path = self::instance()->get_root();
78 80
 		$path .= 'images';
@@ -110,11 +112,13 @@  discard block
 block discarded – undo
110 112
 		foreach((array) $files as $file)
111 113
 		{
112 114
 			$file_path = self::instance()->get_path($type, $file);
113
-			if(in_array($file_path, self::instance()->get_included_files()) && $type !== 'view')
114
-				continue;
115
+			if(in_array($file_path, self::instance()->get_included_files()) && $type !== 'view') {
116
+							continue;
117
+			}
115 118
 			
116
-			if(!file_exists($file_path))
117
-				Debugger::logMessage("Requested file does not exist: {$type}, {$file}");
119
+			if(!file_exists($file_path)) {
120
+							Debugger::logMessage("Requested file does not exist: {$type}, {$file}");
121
+			}
118 122
 			
119 123
 			self::instance()->add_included_file($file_path);
120 124
 			
@@ -163,10 +167,11 @@  discard block
 block discarded – undo
163 167
 		
164 168
 		$reflectionObject = self::create_reflection_class($file);
165 169
 		
166
-		if($reflectionObject->hasMethod('__construct'))
167
-			return $reflectionObject->newInstanceArgs($data);
168
-		else
169
-			return $reflectionObject->newInstance();
170
+		if($reflectionObject->hasMethod('__construct')) {
171
+					return $reflectionObject->newInstanceArgs($data);
172
+		} else {
173
+					return $reflectionObject->newInstance();
174
+		}
170 175
 	}
171 176
 
172 177
 	public static function getRoot()
Please login to merge, or discard this patch.
utility/Mail.class.inc.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,10 +20,11 @@
 block discarded – undo
20 20
 
21 21
 	public function setToAddress($email, $person = null)
22 22
 	{
23
-		if($person)
24
-			$this->to[] = "{$person} <{$email}>";
25
-		else
26
-			$this->to[] = "{$email}";
23
+		if($person) {
24
+					$this->to[] = "{$person} <{$email}>";
25
+		} else {
26
+					$this->to[] = "{$email}";
27
+		}
27 28
 		return $this;
28 29
 	}
29 30
 
Please login to merge, or discard this patch.
utility/Request.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@  discard block
 block discarded – undo
20 20
 	{
21 21
 		if($key)
22 22
 		{
23
-			if(isset(self::$server[$key]))
24
-				return self::$server[$key];
23
+			if(isset(self::$server[$key])) {
24
+							return self::$server[$key];
25
+			}
25 26
 			return false;
26 27
 		}
27 28
 		return self::$server;
@@ -29,8 +30,9 @@  discard block
 block discarded – undo
29 30
 
30 31
 	static function isAjax()
31 32
 	{
32
-		if(self::getServer(self::$AJAX_REQUEST))
33
-			return true;
33
+		if(self::getServer(self::$AJAX_REQUEST)) {
34
+					return true;
35
+		}
34 36
 		return false;
35 37
 	}
36 38
 
@@ -38,8 +40,9 @@  discard block
 block discarded – undo
38 40
 	{
39 41
 		if($key)
40 42
 		{
41
-			if(isset(self::$get[$key]))
42
-				return self::$get[$key];
43
+			if(isset(self::$get[$key])) {
44
+							return self::$get[$key];
45
+			}
43 46
 			return false;
44 47
 		}
45 48
 		return self::$get;
@@ -49,8 +52,9 @@  discard block
 block discarded – undo
49 52
 	{
50 53
 		if($key)
51 54
 		{
52
-			if(isset(self::$post[$key]))
53
-				return self::$post[$key];
55
+			if(isset(self::$post[$key])) {
56
+							return self::$post[$key];
57
+			}
54 58
 			return false;
55 59
 		}
56 60
 		return self::$post;
Please login to merge, or discard this patch.