Completed
Push — master ( 460d04...99f0cc )
by Jacob
03:38 queued 10s
created
utility/cron/StreamCron.class.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 
62 62
 	private function remove_existing($result, $type)
63 63
 	{
64
-		foreach($result as $key => $row)
64
+		foreach ($result as $key => $row)
65 65
 		{
66 66
 			$stream_result = ActivityCollector::getPostByFields($row->id, $type);
67
-			if($stream_result)
67
+			if ($stream_result)
68 68
 				unset($result[$key]);
69 69
 		}
70 70
 		return $result;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 	private function add_posts($result, $type)
74 74
 	{
75
-		foreach($result as $row)
75
+		foreach ($result as $row)
76 76
 		{
77 77
 			$query = sprintf(self::$QUERY, $type, $row->id, $row->date);
78 78
 			Database::execute($query);
Please login to merge, or discard this patch.
utility/cron/ErrorCron.class.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,23 +13,23 @@  discard block
 block discarded – undo
13 13
 
14 14
 	function __construct()
15 15
 	{
16
-		if(Loader::isLive())
16
+		if (Loader::isLive())
17 17
 			$handle[] = self::$live_root;
18 18
 		else
19 19
 			$handle[] = self::$test_root;
20 20
 		
21 21
 		$i = 0;
22
-		while(isset($handle[$i]))
22
+		while (isset($handle[$i]))
23 23
 		{
24 24
 			$path = $handle[$i];
25 25
 			$fh = opendir($path);
26
-			while(false !== ($file = readdir($fh)))
26
+			while (false !== ($file = readdir($fh)))
27 27
 			{
28
-				if($file != '.' && $file != '..')
28
+				if ($file != '.' && $file != '..')
29 29
 				{
30
-					if(is_dir("{$path}/{$file}"))
30
+					if (is_dir("{$path}/{$file}"))
31 31
 						$handle[] = "{$path}/{$file}";
32
-					if($file == 'error.log')
32
+					if ($file == 'error.log')
33 33
 						$this->error_files[] = "{$path}/{$file}";
34 34
 				}
35 35
 			}
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 	{
43 43
 		$message = '';
44 44
 		
45
-		if(count($this->error_files) > 0)
45
+		if (count($this->error_files) > 0)
46 46
 		{
47 47
 			$message .= "Errors from flat-file logs.\n\n";
48
-			foreach($this->error_files as $error_file)
48
+			foreach ($this->error_files as $error_file)
49 49
 			{
50 50
 				$contents = file_get_contents($error_file);
51 51
 				$message .= "{$error_file}\n{$contents}\n\n";
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 		$mail->setMessage($message);
61 61
 		$mail->send();
62 62
 		
63
-		if(count($this->error_files) > 0)
63
+		if (count($this->error_files) > 0)
64 64
 		{
65
-			foreach($this->error_files as $error_file)
65
+			foreach ($this->error_files as $error_file)
66 66
 			{
67 67
 			//	if(file_exists($error_file))
68 68
 			//		unlink($error_file);
Please login to merge, or discard this patch.
utility/cron/BookCron.class.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 
20 20
 	public function activate()
21 21
 	{
22
-		if(!$this->xml)
22
+		if (!$this->xml)
23 23
 			return $this->error('Could not connect to feed.');
24 24
 		
25
-		foreach($this->xml->channel->item as $item)
25
+		foreach ($this->xml->channel->item as $item)
26 26
 		{
27
-			if(strtotime($item->user_read_at) <= 0)
27
+			if (strtotime($item->user_read_at) <= 0)
28 28
 				continue;
29 29
 			
30 30
 			$title = $item->title;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 			$date_added = date('Y-m-d H:i:s', strtotime($item->user_date_created));
43 43
 			
44 44
 			$book_result = BookCollector::getBookByFields($title, $author);
45
-			if($book_result !== null)
45
+			if ($book_result !== null)
46 46
 				continue;
47 47
 			
48 48
 			$query = sprintf(self::$QUERY, $title, $author, $link, $description, $image, $date_read, $date_added);
Please login to merge, or discard this patch.
utility/cron/DistanceCron.class.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
 
21 21
 	public function activate()
22 22
 	{
23
-		if(!$this->json)
23
+		if (!$this->json)
24 24
 			return $this->error('Could not connect to feed.');
25 25
 		
26 26
 		$count = 0;
27
-		foreach($this->json->entries as $entry)
27
+		foreach ($this->json->entries as $entry)
28 28
 		{
29 29
 			$type = $entry->workout->activity_type;
30 30
 			$type = strtolower($type);
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 			$date = date('Y-m-d H:i:s', strtotime($entry->at));
42 42
 			
43 43
 			$distance_result = DistanceCollector::getDistanceByFields($date, $type, $distance);
44
-			if($distance_result !== null)
44
+			if ($distance_result !== null)
45 45
 				continue;
46 46
 			
47 47
 			$query = sprintf(self::$QUERY, $type, $distance, $url, $felt, $title, $message, $date);
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.
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/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/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.