Completed
Branch master (de1ee7)
by Jacob
05:01
created
utility/Environment.class.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 	public function __construct($user_agent = null)
11 11
 	{
12
-		if(!isset($user_agent))
12
+		if (!isset($user_agent))
13 13
 			$user_agent = Request::getServer('HTTP_USER_AGENT');
14 14
 		$this->user_agent = $user_agent;
15 15
 	}
Please login to merge, or discard this patch.
utility/Header.class.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -186,10 +186,10 @@  discard block
 block discarded – undo
186 186
 
187 187
 	private static function send($array, $gzip = true)
188 188
 	{
189
-		if($gzip)
189
+		if ($gzip)
190 190
 			self::start_gzipping();
191 191
 		
192
-		foreach($array as $row)
192
+		foreach ($array as $row)
193 193
 		{
194 194
 			header($row, TRUE);
195 195
 		}
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
 
198 198
 	private static function get_date($timestamp = false)
199 199
 	{
200
-		if($timestamp == 0)
200
+		if ($timestamp == 0)
201 201
 			$timestamp = time();
202 202
 		return gmdate('D, d M Y H:i:s \G\M\T', $timestamp);
203 203
 	}
204 204
 
205 205
 	private static function start_gzipping()
206 206
 	{
207
-		if(!ob_start('ob_gzhandler'))
207
+		if (!ob_start('ob_gzhandler'))
208 208
             ob_start();
209 209
 	}
210 210
 
Please login to merge, or discard this patch.
utility/ImageOld.class.inc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	public function setSize($size)
54 54
 	{
55
-		if($this->get_version() > 1)
55
+		if ($this->get_version() > 1)
56 56
 			$position = strrpos($this->file, '-v');
57 57
 		else
58 58
 			$position = strrpos($this->file, '.');
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 	public function getDimensions()
64 64
 	{
65
-		if(!$this->isValid())
65
+		if (!$this->isValid())
66 66
 			return false;
67 67
 		$imageinfo = getimagesize($this->getInternalPath());
68 68
 		return array($imageinfo[0], $imageinfo[1]);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
 	private function get_image($image)
87 87
 	{
88
-		if(preg_match(self::$VERSION_PREG_MATCH, $image))
88
+		if (preg_match(self::$VERSION_PREG_MATCH, $image))
89 89
 			return preg_replace(self::$VERSION_PREG_MATCH, '', $image);
90 90
 		else
91 91
 			return $image;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
 	private function get_file($image)
101 101
 	{
102
-		if($this->get_version() > 1)
102
+		if ($this->get_version() > 1)
103 103
 		{
104 104
 			$position = strrpos($image, '.');
105 105
 			return substr($image, 0, $position) . '-v' . $this->get_version() . substr($image, $position);
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 	private $version;
112 112
 	private function get_version()
113 113
 	{
114
-		if(!$this->version)
114
+		if (!$this->version)
115 115
 		{
116
-			$path = Loader::getRoot() .'/images/' . substr($this->image, 0, strrpos($this->image, '.')) . '*';
116
+			$path = Loader::getRoot() . '/images/' . substr($this->image, 0, strrpos($this->image, '.')) . '*';
117 117
 			$files = glob($path);
118
-			if(count($files) > 0)
118
+			if (count($files) > 0)
119 119
 			{
120 120
 				preg_match(self::$VERSION_PREG_MATCH, $files[0], $matches);
121
-				if(count($matches))
121
+				if (count($matches))
122 122
 					$this->version = $matches[1];
123 123
 				else
124 124
 					$this->version = 1;
Please login to merge, or discard this patch.
utility/Loader.class.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 
18 18
 	public static function instance()
19 19
 	{
20
-		if(!isset(self::$instance))
20
+		if (!isset(self::$instance))
21 21
 			self::$instance = new Loader();
22 22
 		return self::$instance;
23 23
 	}
24 24
 
25 25
 	private function get_root()
26 26
 	{
27
-		if(!isset($this->root))
27
+		if (!isset($this->root))
28 28
 		{
29 29
 			$current_directory = dirname(__FILE__);
30 30
 			$current_directory = substr($current_directory, 0, -7);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 	private static function get_extension($type)
54 54
 	{
55
-		switch($type)
55
+		switch ($type)
56 56
 		{
57 57
 			case 'collector' :
58 58
 			case 'controller' :
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
 	public static function getImagePath($type, $file)
73 73
 	{
74
-		if($type == 'photo')
74
+		if ($type == 'photo')
75 75
 			$type = 'photo/processed';
76 76
 		
77 77
 		$path = self::instance()->get_root();
@@ -107,18 +107,18 @@  discard block
 block discarded – undo
107 107
 
108 108
 	public static function load($type, $files, $data = array())
109 109
 	{
110
-		foreach((array) $files as $file)
110
+		foreach ((array) $files as $file)
111 111
 		{
112 112
 			$file_path = self::instance()->get_path($type, $file);
113
-			if(in_array($file_path, self::instance()->get_included_files()) && $type !== 'view')
113
+			if (in_array($file_path, self::instance()->get_included_files()) && $type !== 'view')
114 114
 				continue;
115 115
 			
116
-			if(!file_exists($file_path))
116
+			if (!file_exists($file_path))
117 117
 				Debugger::logMessage("Requested file does not exist: {$type}, {$file}");
118 118
 			
119 119
 			self::instance()->add_included_file($file_path);
120 120
 			
121
-			switch($type)
121
+			switch ($type)
122 122
 			{
123 123
 				case 'images' :
124 124
 				case 'scripts' :
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 		
149 149
 		$reflectionObject = self::create_reflection_class($file);
150 150
 		
151
-		if(
151
+		if (
152 152
 			$reflectionObject->hasMethod('instance') &&
153 153
 			$reflectionObject->getMethod('instance')->isStatic())
154 154
 		{
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		
164 164
 		$reflectionObject = self::create_reflection_class($file);
165 165
 		
166
-		if($reflectionObject->hasMethod('__construct'))
166
+		if ($reflectionObject->hasMethod('__construct'))
167 167
 			return $reflectionObject->newInstanceArgs($data);
168 168
 		else
169 169
 			return $reflectionObject->newInstance();
Please login to merge, or discard this patch.
utility/Mail.class.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 	public function setToAddress($email, $person = null)
22 22
 	{
23
-		if($person)
23
+		if ($person)
24 24
 			$this->to[] = "{$person} <{$email}>";
25 25
 		else
26 26
 			$this->to[] = "{$email}";
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 	public function send()
43 43
 	{
44
-		if(!Loader::isLive())
44
+		if (!Loader::isLive())
45 45
 		{
46 46
 			Debugger::logMessage("Email Failed:\n\n{$this->message}");
47 47
 			return;
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 		$subject = $this->subject;
52 52
 		$message = $this->message;
53 53
 		
54
-		if(empty($to) || empty($subject) || empty($message))
54
+		if (empty($to) || empty($subject) || empty($message))
55 55
 		{
56 56
 			Debugger::logMessage("Attempted to send an email without all of the required fields.");
57 57
 			return;
58 58
 		}
59 59
 		
60 60
 		$header = '';
61
-		foreach($this->headers as $key => $value)
61
+		foreach ($this->headers as $key => $value)
62 62
 		{
63 63
 			$header .= "{$key}: {$value}\r\n";
64 64
 		}
Please login to merge, or discard this patch.
utility/Request.class.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 
19 19
 	static function getServer($key = null)
20 20
 	{
21
-		if($key)
21
+		if ($key)
22 22
 		{
23
-			if(isset(self::$server[$key]))
23
+			if (isset(self::$server[$key]))
24 24
 				return self::$server[$key];
25 25
 			return false;
26 26
 		}
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 
30 30
 	static function isAjax()
31 31
 	{
32
-		if(self::getServer(self::$AJAX_REQUEST))
32
+		if (self::getServer(self::$AJAX_REQUEST))
33 33
 			return true;
34 34
 		return false;
35 35
 	}
36 36
 
37 37
 	static function getGet($key = null)
38 38
 	{
39
-		if($key)
39
+		if ($key)
40 40
 		{
41
-			if(isset(self::$get[$key]))
41
+			if (isset(self::$get[$key]))
42 42
 				return self::$get[$key];
43 43
 			return false;
44 44
 		}
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 	static function getPost($key = null)
49 49
 	{
50
-		if($key)
50
+		if ($key)
51 51
 		{
52
-			if(isset(self::$post[$key]))
52
+			if (isset(self::$post[$key]))
53 53
 				return self::$post[$key];
54 54
 			return false;
55 55
 		}
Please login to merge, or discard this patch.
utility/Search.class.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,20 +39,20 @@  discard block
 block discarded – undo
39 39
 	public function perform()
40 40
 	{
41 41
 		$weighted_array = array();
42
-		foreach($this->result as $row)
42
+		foreach ($this->result as $row)
43 43
 		{
44 44
 			$weight = $this->get_search_weight($row);
45
-			if($weight > 0)
45
+			if ($weight > 0)
46 46
 				$weighted_array[$row->id] = $weight;
47 47
 		}
48 48
 		arsort($weighted_array);
49 49
 		
50 50
 		$final_array = array();
51
-		foreach($weighted_array as $id => $weight)
51
+		foreach ($weighted_array as $id => $weight)
52 52
 		{
53
-			foreach($this->result as $row)
53
+			foreach ($this->result as $row)
54 54
 			{
55
-				if($row->id == $id)
55
+				if ($row->id == $id)
56 56
 					$final_array[] = $row;
57 57
 			}
58 58
 		}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	private function get_search_weight($row)
63 63
 	{
64 64
 		$weight = 0;
65
-		foreach($this->weight as $weight_array)
65
+		foreach ($this->weight as $weight_array)
66 66
 		{
67 67
 			$text = $row->{$weight_array['field']};
68 68
 			$weight += $weight_array['weight'] * substr_count(strtolower($text), strtolower($this->query));
Please login to merge, or discard this patch.
utility/URLDecode.class.inc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
 	static private function form_url_array($host, $uri)
16 16
 	{
17 17
 		$uri = substr($uri, 1);
18
-		if(strpos($uri, '?'))
18
+		if (strpos($uri, '?'))
19 19
 			$uri = substr($uri, 0, strpos($uri, '?'));
20 20
 		$uri_array = explode('/', $uri);
21 21
 		
22
-		if(!Loader::isLive())
22
+		if (!Loader::isLive())
23 23
 			$host = substr($host, strpos($host, '.') + 1);
24 24
 		
25 25
 		self::$array['host'] = $host;
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		self::$array['base'] = 'http://' . (!Loader::isLive() ? 'dev.' : '') . $host . '/';
34 34
 		self::$array['uri'] = '/' . implode('/', $uri_array);
35 35
 		
36
-		if(end($uri_array) == '')
36
+		if (end($uri_array) == '')
37 37
 			$uri_array = array_slice($uri_array, 0, count($uri_array) - 1);
38 38
 		self::$array['pieces'] = (array) $uri_array;
39 39
 	}
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
 	static function getExtension()
62 62
 	{
63 63
 		$file = self::getPiece(-1);
64
-		if(substr($file, -1) == '/')
64
+		if (substr($file, -1) == '/')
65 65
 			return false;
66
-		return substr($file, strrpos($file, '.') + 1);;
66
+		return substr($file, strrpos($file, '.') + 1); ;
67 67
 	}
68 68
 
69 69
 	static function getPiece($piece = null)
70 70
 	{
71
-		if(!$piece)
71
+		if (!$piece)
72 72
 			return self::$array['pieces'];
73 73
 		
74
-		if($piece == -1)
74
+		if ($piece == -1)
75 75
 			return end(self::$array['pieces']);
76 76
 		
77 77
 		$piece = $piece - 1;
78
-		if(array_key_exists($piece, self::$array['pieces']))
78
+		if (array_key_exists($piece, self::$array['pieces']))
79 79
 			return self::$array['pieces'][$piece];
80 80
 		return;
81 81
 	}
Please login to merge, or discard this patch.
utility/Validate.class.inc.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,39 +11,39 @@  discard block
 block discarded – undo
11 11
 
12 12
 	public static function isBoolean($value, $strict = false)
13 13
 	{
14
-		if($strict && ($value === true || $value === false))
14
+		if ($strict && ($value === true || $value === false))
15 15
 			return true;
16
-		if(!$strict && ((bool) $value === true || (bool) $value === false))
16
+		if (!$strict && ((bool) $value === true || (bool) $value === false))
17 17
 			return true;
18 18
 		return false;
19 19
 	}
20 20
 
21 21
 	public static function isDate($value)
22 22
 	{
23
-		if(strtotime($value) !== -1)
23
+		if (strtotime($value) !== -1)
24 24
 			return true;
25
-		if(date('y', $value) !== false)
25
+		if (date('y', $value) !== false)
26 26
 			return true;
27 27
 		return false;
28 28
 	}
29 29
 
30 30
 	public static function isInteger($value, $strict = false)
31 31
 	{
32
-		if($strict)
32
+		if ($strict)
33 33
 			return is_int($value);
34 34
 		return (int) $value == $value;
35 35
 	}
36 36
 
37 37
 	public static function isIP($value)
38 38
 	{
39
-		if(self::isInteger(ip2long($value)))
39
+		if (self::isInteger(ip2long($value)))
40 40
 			return true;
41 41
 		return false;
42 42
 	}
43 43
 
44 44
 	public static function isString($value, $strict = false)
45 45
 	{
46
-		if($strict)
46
+		if ($strict)
47 47
 			return is_string($value);
48 48
 		return (string) $value == $value;
49 49
 	}
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 	private static function check_value($pattern, $string)
68 68
 	{
69 69
 		preg_match($pattern, $string, $matches);
70
-		if(empty($matches))
70
+		if (empty($matches))
71 71
 			return false;
72 72
 		return $matches[0] == $string;
73 73
 	}
74 74
 
75 75
 	public static function checkRequest($type, $key, $validation, $strict = false)
76 76
 	{
77
-		switch($type)
77
+		switch ($type)
78 78
 		{
79 79
 			case 'server':
80 80
 				$value = Request::getServer($key);
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
 			break;
85 85
 		}
86 86
 		
87
-		if($value == false)
87
+		if ($value == false)
88 88
 			return false;
89 89
 		
90
-		switch($validation)
90
+		switch ($validation)
91 91
 		{
92 92
 			case 'boolean':
93 93
 				return self::isBoolean($value, $strict);
Please login to merge, or discard this patch.