Completed
Branch master (de1ee7)
by Jacob
05:01
created
utility/Cookie.class.inc.php 3 patches
Doc Comments   +17 added lines patch added patch discarded remove patch
@@ -14,9 +14,20 @@  discard block
 block discarded – undo
14 14
 		$this->class_new = $class_name;
15 15
 	}
16 16
 
17
+	/**
18
+	 * @return string
19
+	 */
17 20
 	abstract protected function getName();
18 21
 	abstract protected function getDuration();
22
+
23
+	/**
24
+	 * @return string|null
25
+	 */
19 26
 	abstract protected function getDomain();
27
+
28
+	/**
29
+	 * @return string|null
30
+	 */
20 31
 	abstract protected function getPath();
21 32
 
22 33
 	public function setValue($value)
@@ -28,6 +39,9 @@  discard block
 block discarded – undo
28 39
 		return $this;
29 40
 	}
30 41
 
42
+	/**
43
+	 * @return string|null
44
+	 */
31 45
 	public function getValue()
32 46
 	{
33 47
 		if(!$this->is_loaded)
@@ -118,6 +132,9 @@  discard block
 block discarded – undo
118 132
 		return $set_cookie;
119 133
 	}
120 134
 
135
+	/**
136
+	 * @param string $class_name
137
+	 */
121 138
 	public static function instance($class_name)
122 139
 	{
123 140
 		return Loader::loadNew('utility', "cookie/{$class_name}Cookie", (array) $class_name);
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 	public function setValue($value)
23 23
 	{
24
-		if(!$this->is_loaded)
24
+		if (!$this->is_loaded)
25 25
 			$this->load();
26 26
 		
27 27
 		$this->value = $value;
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 	public function getValue()
32 32
 	{
33
-		if(!$this->is_loaded)
33
+		if (!$this->is_loaded)
34 34
 			$this->load();
35 35
 		return $this->value;
36 36
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function exists()
44 44
 	{
45
-		if(!$this->is_loaded)
45
+		if (!$this->is_loaded)
46 46
 			$this->load();
47 47
 		return $this->exists;
48 48
 	}
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 	private final function load()
51 51
 	{
52 52
 		$name = $this->getName();
53
-		if(isset($_COOKIE[$name]))
53
+		if (isset($_COOKIE[$name]))
54 54
 			$value = $_COOKIE[$name];
55 55
 		
56
-		if(isset($value))
56
+		if (isset($value))
57 57
 		{
58 58
 			$this->value = $value;
59 59
 			$this->exists = true;
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 
67 67
 	public final function save()
68 68
 	{
69
-		if(!$this->check_values())
69
+		if (!$this->check_values())
70 70
 		{
71 71
 			Debugger::error('Attempt to create a cookie without all of the values being set!');
72 72
 			return false;
73 73
 		}
74 74
 		
75
-		if(!$this->set_cookie())
75
+		if (!$this->set_cookie())
76 76
 		{
77 77
 			Debugger::log('There was a problem saving the cookie.');
78 78
 			return false;
@@ -84,23 +84,23 @@  discard block
 block discarded – undo
84 84
 	private final function check_values()
85 85
 	{
86 86
 		$name = $this->getName();
87
-		if(empty($name) || strlen($name) < 1)
87
+		if (empty($name) || strlen($name) < 1)
88 88
 			return false;
89 89
 		
90 90
 		$value = $this->getValue();
91
-		if(!isset($value) || strlen($value) < 1)
91
+		if (!isset($value) || strlen($value) < 1)
92 92
 			return false;
93 93
 		
94 94
 		$expiration = $this->getExpiration();
95
-		if(!isset($expiration) || !is_int($expiration))
95
+		if (!isset($expiration) || !is_int($expiration))
96 96
 			return false;
97 97
 		
98 98
 		$domain = $this->getDomain();
99
-		if(!isset($domain) || strlen($domain) < 1)
99
+		if (!isset($domain) || strlen($domain) < 1)
100 100
 			return false;
101 101
 		
102 102
 		$path = $this->getPath();
103
-		if(!isset($path) || strlen($path) < 1)
103
+		if (!isset($path) || strlen($path) < 1)
104 104
 			return false;
105 105
 		
106 106
 		return true;
Please login to merge, or discard this patch.
Braces   +29 added lines, -20 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 	public function setValue($value)
23 23
 	{
24
-		if(!$this->is_loaded)
25
-			$this->load();
24
+		if(!$this->is_loaded) {
25
+					$this->load();
26
+		}
26 27
 		
27 28
 		$this->value = $value;
28 29
 		return $this;
@@ -30,8 +31,9 @@  discard block
 block discarded – undo
30 31
 
31 32
 	public function getValue()
32 33
 	{
33
-		if(!$this->is_loaded)
34
-			$this->load();
34
+		if(!$this->is_loaded) {
35
+					$this->load();
36
+		}
35 37
 		return $this->value;
36 38
 	}
37 39
 
@@ -42,24 +44,26 @@  discard block
 block discarded – undo
42 44
 
43 45
 	public function exists()
44 46
 	{
45
-		if(!$this->is_loaded)
46
-			$this->load();
47
+		if(!$this->is_loaded) {
48
+					$this->load();
49
+		}
47 50
 		return $this->exists;
48 51
 	}
49 52
 
50 53
 	private final function load()
51 54
 	{
52 55
 		$name = $this->getName();
53
-		if(isset($_COOKIE[$name]))
54
-			$value = $_COOKIE[$name];
56
+		if(isset($_COOKIE[$name])) {
57
+					$value = $_COOKIE[$name];
58
+		}
55 59
 		
56 60
 		if(isset($value))
57 61
 		{
58 62
 			$this->value = $value;
59 63
 			$this->exists = true;
64
+		} else {
65
+					$this->exists = false;
60 66
 		}
61
-		else
62
-			$this->exists = false;
63 67
 		
64 68
 		$this->is_loaded = true;
65 69
 	}
@@ -84,24 +88,29 @@  discard block
 block discarded – undo
84 88
 	private final function check_values()
85 89
 	{
86 90
 		$name = $this->getName();
87
-		if(empty($name) || strlen($name) < 1)
88
-			return false;
91
+		if(empty($name) || strlen($name) < 1) {
92
+					return false;
93
+		}
89 94
 		
90 95
 		$value = $this->getValue();
91
-		if(!isset($value) || strlen($value) < 1)
92
-			return false;
96
+		if(!isset($value) || strlen($value) < 1) {
97
+					return false;
98
+		}
93 99
 		
94 100
 		$expiration = $this->getExpiration();
95
-		if(!isset($expiration) || !is_int($expiration))
96
-			return false;
101
+		if(!isset($expiration) || !is_int($expiration)) {
102
+					return false;
103
+		}
97 104
 		
98 105
 		$domain = $this->getDomain();
99
-		if(!isset($domain) || strlen($domain) < 1)
100
-			return false;
106
+		if(!isset($domain) || strlen($domain) < 1) {
107
+					return false;
108
+		}
101 109
 		
102 110
 		$path = $this->getPath();
103
-		if(!isset($path) || strlen($path) < 1)
104
-			return false;
111
+		if(!isset($path) || strlen($path) < 1) {
112
+					return false;
113
+		}
105 114
 		
106 115
 		return true;
107 116
 	}
Please login to merge, or discard this patch.
utility/cron/ChangelogCron.class.inc.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@
 block discarded – undo
49 49
 		Database::execute($query);
50 50
 	}
51 51
 
52
+	/**
53
+	 * @return string
54
+	 */
52 55
 	private function get_changeset_to_check()
53 56
 	{
54 57
 		$changeset = ChangelogCollector::getMostRecentChange();
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 	public function activate()
17 17
 	{
18 18
 		$loop_count = 0;
19
-		for($loop_count = 0; $loop_count < self::$MAXIMUM_LOOP_COUNT; $loop_count++)
19
+		for ($loop_count = 0; $loop_count < self::$MAXIMUM_LOOP_COUNT; $loop_count++)
20 20
 		{
21 21
 			$changeset_to_check = $this->get_changeset_to_check();
22 22
 			$data = $this->get_changeset_page_data($changeset_to_check);
23 23
 			
24
-			if(!isset($data))
24
+			if (!isset($data))
25 25
 				break;
26 26
 			
27 27
 			$this->save_changeset_data($data);
28
-			if($loop_count > 20)
28
+			if ($loop_count > 20)
29 29
 				exit;
30 30
 		}
31 31
 		
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	{
54 54
 		$changeset = ChangelogCollector::getMostRecentChange();
55 55
 		
56
-		if($changeset === null)
56
+		if ($changeset === null)
57 57
 			return 1;
58 58
 		
59 59
 		$number = $changeset->number;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		$changeset_page = $this->get_changeset_page($page);
67 67
 		
68 68
 		preg_match('@<h1>(.+)</h1>@', $changeset_page, $match);
69
-		if(stristr($match[1], 'Error: Invalid Changeset Number') !== false)
69
+		if (stristr($match[1], 'Error: Invalid Changeset Number') !== false)
70 70
 			return;
71 71
 		
72 72
 		preg_match('@<h1>Changeset (\d+)</h1>@', $changeset_page, $match);
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,12 +21,14 @@  discard block
 block discarded – undo
21 21
 			$changeset_to_check = $this->get_changeset_to_check();
22 22
 			$data = $this->get_changeset_page_data($changeset_to_check);
23 23
 			
24
-			if(!isset($data))
25
-				break;
24
+			if(!isset($data)) {
25
+							break;
26
+			}
26 27
 			
27 28
 			$this->save_changeset_data($data);
28
-			if($loop_count > 20)
29
-				exit;
29
+			if($loop_count > 20) {
30
+							exit;
31
+			}
30 32
 		}
31 33
 		
32 34
 		return true;
@@ -53,8 +55,9 @@  discard block
 block discarded – undo
53 55
 	{
54 56
 		$changeset = ChangelogCollector::getMostRecentChange();
55 57
 		
56
-		if($changeset === null)
57
-			return 1;
58
+		if($changeset === null) {
59
+					return 1;
60
+		}
58 61
 		
59 62
 		$number = $changeset->number;
60 63
 		$number++;
@@ -66,8 +69,9 @@  discard block
 block discarded – undo
66 69
 		$changeset_page = $this->get_changeset_page($page);
67 70
 		
68 71
 		preg_match('@<h1>(.+)</h1>@', $changeset_page, $match);
69
-		if(stristr($match[1], 'Error: Invalid Changeset Number') !== false)
70
-			return;
72
+		if(stristr($match[1], 'Error: Invalid Changeset Number') !== false) {
73
+					return;
74
+		}
71 75
 		
72 76
 		preg_match('@<h1>Changeset (\d+)</h1>@', $changeset_page, $match);
73 77
 		$number = $match[1];
Please login to merge, or discard this patch.
utility/cron/Cron.class.inc.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -7,6 +7,9 @@
 block discarded – undo
7 7
 
8 8
 	abstract public function activate();
9 9
 
10
+	/**
11
+	 * @param string $value
12
+	 */
10 13
 	protected function error($value)
11 14
 	{
12 15
 		trigger_error("Cron failed: {$value}");
Please login to merge, or discard this patch.
utility/cron/StreamCron.class.inc.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -59,6 +59,9 @@  discard block
 block discarded – undo
59 59
 		$this->add_posts($youtube_result, 'youtube');
60 60
 	}
61 61
 
62
+	/**
63
+	 * @param string $type
64
+	 */
62 65
 	private function remove_existing($result, $type)
63 66
 	{
64 67
 		foreach($result as $key => $row)
@@ -70,6 +73,9 @@  discard block
 block discarded – undo
70 73
 		return $result;
71 74
 	}
72 75
 
76
+	/**
77
+	 * @param string $type
78
+	 */
73 79
 	private function add_posts($result, $type)
74 80
 	{
75 81
 		foreach($result as $row)
Please login to merge, or discard this 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.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,8 +64,9 @@
 block discarded – undo
64 64
 		foreach($result as $key => $row)
65 65
 		{
66 66
 			$stream_result = ActivityCollector::getPostByFields($row->id, $type);
67
-			if($stream_result)
68
-				unset($result[$key]);
67
+			if($stream_result) {
68
+							unset($result[$key]);
69
+			}
69 70
 		}
70 71
 		return $result;
71 72
 	}
Please login to merge, or discard this patch.
utility/cron/TwitterCron.class.inc.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -239,6 +239,9 @@
 block discarded – undo
239 239
 		return $text;
240 240
 	}
241 241
 
242
+	/**
243
+	 * @param string $type
244
+	 */
242 245
 	private function get_replace_text($entity_type, $entity, $type)
243 246
 	{
244 247
 		switch($entity_type)
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,21 +20,21 @@
 block discarded – undo
20 20
 	private static $USER_MENTION_LINK = '<a href="https://twitter.com/%1$s" rel="nofollow" target="_blank" title="%2$s (%1$s) on Twitter">@%1$s</a>';
21 21
 	private static $MEDIA_LINK = '<a class="photo" href="%s" rel="nofollow" target="_blank" title="%s"><img src="%s:%s" alt="%s" height="%s" width="%s" /></a>';
22 22
 
23
-    private $consumer_key;
24
-    private $consumer_secret;
25
-    private $access_token;
26
-    private $access_secret;
23
+	private $consumer_key;
24
+	private $consumer_secret;
25
+	private $access_token;
26
+	private $access_secret;
27 27
 
28 28
 	private $json;
29 29
 
30 30
 	public function __construct()
31 31
 	{
32
-        global $config;
32
+		global $config;
33 33
 
34
-        $this->consumer_key = $config->twitter->consumer_key;
35
-        $this->consumer_secret = $config->twitter->consumer_secret;
36
-        $this->access_token = $config->twitter->access_token;
37
-        $this->access_secret = $config->twitter->access_secret;
34
+		$this->consumer_key = $config->twitter->consumer_key;
35
+		$this->consumer_secret = $config->twitter->consumer_secret;
36
+		$this->access_token = $config->twitter->access_token;
37
+		$this->access_secret = $config->twitter->access_secret;
38 38
 
39 39
 		$json = $this->get_data();
40 40
 		
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	private $oauth_array;
84 84
 	private function get_oauth_array()
85 85
 	{
86
-		if(!isset($this->oauth_array))
86
+		if (!isset($this->oauth_array))
87 87
 		{
88 88
 			$this->oauth_array = array(
89 89
 				'screen_name' => self::$SCREEN_NAME,
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	{
117 117
 		$encoded_array = array();
118 118
 		ksort($array);
119
-		foreach($array as $key => $value)
119
+		foreach ($array as $key => $value)
120 120
 		{
121 121
 			$value = rawurlencode($value);
122 122
 			$value = ($wrap_values) ? '"' . $value . '"' : $value;
@@ -127,27 +127,27 @@  discard block
 block discarded – undo
127 127
 
128 128
 	public function activate()
129 129
 	{
130
-		if(!$this->json)
130
+		if (!$this->json)
131 131
 			return $this->error('Could not connect to twitter json feed.');
132 132
 		
133 133
 		$count = 0;
134
-		foreach($this->json as $status)
134
+		foreach ($this->json as $status)
135 135
 		{
136 136
 			$text = Database::escape($status->text);
137 137
 			$date = date('Y-m-d H:i:s', strtotime($status->created_at));
138 138
 			
139 139
 			$tweet_result = TwitterCollector::getTweetByFields($date, $text);
140
-			if($tweet_result !== null)
140
+			if ($tweet_result !== null)
141 141
 			{
142 142
 				$favorites = (int) $status->favorite_count;
143
-				if($favorites != 0 && $tweet_result->favorites != $favorites)
143
+				if ($favorites != 0 && $tweet_result->favorites != $favorites)
144 144
 				{
145 145
 					$query = sprintf(self::$UPDATE_FAVORITES_QUERY, $favorites, $tweet_result->id);
146 146
 					Database::execute($query);
147 147
 				}
148 148
 				
149 149
 				$retweets = (int) $status->retweet_count;
150
-				if($retweets != 0 && $tweet_result->retweets != $retweets)
150
+				if ($retweets != 0 && $tweet_result->retweets != $retweets)
151 151
 				{
152 152
 					$query = sprintf(self::$UPDATE_RETWEETS_QUERY, $retweets, $tweet_result->id);
153 153
 					Database::execute($query);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 			{
158 158
 				$twitter_id = (string) $status->id_str;
159 159
 				
160
-				if(isset($status->retweeted_status))
160
+				if (isset($status->retweeted_status))
161 161
 				{
162 162
 					$text_formatted = $this->get_formatted($status->retweeted_status->text, $status->retweeted_status->entities);
163 163
 					$text_formatted_full = $this->get_formatted($status->retweeted_status->text, $status->retweeted_status->entities, 'full');
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
 
201 201
 	private function get_source($source)
202 202
 	{
203
-		if(stristr($source, 'tweetdeck'))
203
+		if (stristr($source, 'tweetdeck'))
204 204
 			return 'tweetdeck';
205
-		if(stristr($source, 'windows phone'))
205
+		if (stristr($source, 'windows phone'))
206 206
 			return 'phone';
207 207
 		else
208 208
 			return '';
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
 	private function get_formatted($text, $entities, $type = 'short')
212 212
 	{
213 213
 		$holder = array();
214
-		foreach($entities as $entity_type => $entity_collection)
214
+		foreach ($entities as $entity_type => $entity_collection)
215 215
 		{
216
-			foreach($entity_collection as $entity)
216
+			foreach ($entity_collection as $entity)
217 217
 			{
218 218
 				$start = $entity->indices[0];
219 219
 				$end = $entity->indices[1];
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 		
229 229
 		krsort($holder);
230 230
 		
231
-		foreach($holder as $entity)
231
+		foreach ($holder as $entity)
232 232
 		{
233 233
 			$text = mb_substr($text, 0, $entity->start, 'UTF-8') . $entity->replace . mb_substr($text, $entity->end, 5000, 'UTF-8');
234 234
 		}
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
 	private function get_replace_text($entity_type, $entity, $type)
243 243
 	{
244
-		switch($entity_type)
244
+		switch ($entity_type)
245 245
 		{
246 246
 			case 'hashtags' :
247 247
 				$replace = sprintf(self::$HASHTAG_LINK, $entity->text);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 				$replace = sprintf(self::$USER_MENTION_LINK, $entity->screen_name, $entity->name);
254 254
 				break;
255 255
 			case 'media' :
256
-				if($type == 'full')
256
+				if ($type == 'full')
257 257
 					$replace = sprintf(self::$MEDIA_LINK, $entity->url, $entity->display_url, $entity->media_url, 'large', 'Photo from Twitter', $entity->sizes->large->h, $entity->sizes->large->w);
258 258
 				else
259 259
 					$replace = sprintf(self::$URL_LINK, $entity->url, $entity->expanded_url, $entity->display_url);
Please login to merge, or discard this patch.
Braces   +18 added lines, -16 removed lines patch added patch discarded remove patch
@@ -127,8 +127,9 @@  discard block
 block discarded – undo
127 127
 
128 128
 	public function activate()
129 129
 	{
130
-		if(!$this->json)
131
-			return $this->error('Could not connect to twitter json feed.');
130
+		if(!$this->json) {
131
+					return $this->error('Could not connect to twitter json feed.');
132
+		}
132 133
 		
133 134
 		$count = 0;
134 135
 		foreach($this->json as $status)
@@ -152,8 +153,7 @@  discard block
 block discarded – undo
152 153
 					$query = sprintf(self::$UPDATE_RETWEETS_QUERY, $retweets, $tweet_result->id);
153 154
 					Database::execute($query);
154 155
 				}
155
-			}
156
-			else
156
+			} else
157 157
 			{
158 158
 				$twitter_id = (string) $status->id_str;
159 159
 				
@@ -164,8 +164,7 @@  discard block
 block discarded – undo
164 164
 					
165 165
 					$text_formatted = $this->prepend_original_user($status->retweeted_status->user, $text_formatted);
166 166
 					$text_formatted_full = $this->prepend_original_user($status->retweeted_status->user, $text_formatted_full);
167
-				}
168
-				else
167
+				} else
169 168
 				{
170 169
 					$text_formatted = $this->get_formatted($status->text, $status->entities);
171 170
 					$text_formatted_full = $this->get_formatted($status->text, $status->entities, 'full');
@@ -200,12 +199,14 @@  discard block
 block discarded – undo
200 199
 
201 200
 	private function get_source($source)
202 201
 	{
203
-		if(stristr($source, 'tweetdeck'))
204
-			return 'tweetdeck';
205
-		if(stristr($source, 'windows phone'))
206
-			return 'phone';
207
-		else
208
-			return '';
202
+		if(stristr($source, 'tweetdeck')) {
203
+					return 'tweetdeck';
204
+		}
205
+		if(stristr($source, 'windows phone')) {
206
+					return 'phone';
207
+		} else {
208
+					return '';
209
+		}
209 210
 	}
210 211
 
211 212
 	private function get_formatted($text, $entities, $type = 'short')
@@ -253,10 +254,11 @@  discard block
 block discarded – undo
253 254
 				$replace = sprintf(self::$USER_MENTION_LINK, $entity->screen_name, $entity->name);
254 255
 				break;
255 256
 			case 'media' :
256
-				if($type == 'full')
257
-					$replace = sprintf(self::$MEDIA_LINK, $entity->url, $entity->display_url, $entity->media_url, 'large', 'Photo from Twitter', $entity->sizes->large->h, $entity->sizes->large->w);
258
-				else
259
-					$replace = sprintf(self::$URL_LINK, $entity->url, $entity->expanded_url, $entity->display_url);
257
+				if($type == 'full') {
258
+									$replace = sprintf(self::$MEDIA_LINK, $entity->url, $entity->display_url, $entity->media_url, 'large', 'Photo from Twitter', $entity->sizes->large->h, $entity->sizes->large->w);
259
+				} else {
260
+									$replace = sprintf(self::$URL_LINK, $entity->url, $entity->expanded_url, $entity->display_url);
261
+				}
260 262
 				break;
261 263
 			default :
262 264
 				$replace = '';
Please login to merge, or discard this patch.
utility/Debugger.class.inc.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -28,6 +28,9 @@
 block discarded – undo
28 28
 		return self::$instance;
29 29
 	}
30 30
 
31
+	/**
32
+	 * @param string $message
33
+	 */
31 34
 	public static function log($message)
32 35
 	{
33 36
 		self::instance()->console->logError('Gah, this is using Debugger::log()!');
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 	private static $UNKNOWN_ERROR_FILE		= 'Unknown File';
7 7
 	private static $UNKNOWN_ERROR_LINE		= 'Unknown Line';
8
-	private static $UNKNOWN_ERROR_CONTEXT	= 'Unknown Context';
8
+	private static $UNKNOWN_ERROR_CONTEXT = 'Unknown Context';
9 9
 
10 10
 	private $profiler;
11 11
 	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("{$string}... TYPE: {$code}", $file, $line);
@@ -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();
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
 	public static function display()
83 83
 	{
84
-		if(!Loader::isLive() && self::instance()->display)
84
+		if (!Loader::isLive() && self::instance()->display)
85 85
 			self::instance()->profiler->display();
86 86
 	}
87 87
 
Please login to merge, or discard this 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/Header.class.inc.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -74,6 +74,9 @@  discard block
 block discarded – undo
74 74
 		self::send($array);
75 75
 	}
76 76
 
77
+	/**
78
+	 * @param integer $timestamp
79
+	 */
77 80
 	public static function sendCSS($timestamp)
78 81
 	{
79 82
 		$array = array(
@@ -184,6 +187,9 @@  discard block
 block discarded – undo
184 187
 		self::send($array);
185 188
 	}
186 189
 
190
+	/**
191
+	 * @param string[] $array
192
+	 */
187 193
 	private static function send($array, $gzip = true)
188 194
 	{
189 195
 		if($gzip)
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@
 block discarded – undo
205 205
 	private static function start_gzipping()
206 206
 	{
207 207
 		if(!ob_start('ob_gzhandler'))
208
-            ob_start();
208
+			ob_start();
209 209
 	}
210 210
 
211 211
 }
212 212
\ No newline at end of file
Please login to merge, or discard this 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.
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/Loader.class.inc.php 4 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -69,6 +69,9 @@  discard block
 block discarded – undo
69 69
 		return $extension;
70 70
 	}
71 71
 
72
+	/**
73
+	 * @param string $type
74
+	 */
72 75
 	public static function getImagePath($type, $file)
73 76
 	{
74 77
 		if($type == 'photo')
@@ -142,6 +145,10 @@  discard block
 block discarded – undo
142 145
 		return new ReflectionClass($class_name);
143 146
 	}
144 147
 
148
+	/**
149
+	 * @param string $type
150
+	 * @param string $file
151
+	 */
145 152
 	public static function loadInstance($type, $file)
146 153
 	{
147 154
 		self::load($type, $file);
@@ -157,6 +164,9 @@  discard block
 block discarded – undo
157 164
 		trigger_error("Requested class cannot be instance'd: {$type}, {$file}");
158 165
 	}
159 166
 
167
+	/**
168
+	 * @param string $type
169
+	 */
160 170
 	public static function loadNew($type, $file, $data = array())
161 171
 	{
162 172
 		self::load($type, $file);
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -179,16 +179,16 @@
 block discarded – undo
179 179
 		return self::instance()->is_live;
180 180
 	}
181 181
 
182
-    public static function getRootURL($site = '')
183
-    {
184
-        if (strlen($site) > 0) {
185
-            if ($site == 'waterfalls' && self::instance()->is_live) {
186
-                return 'http://www.waterfallsofthekeweenaw.com/';
187
-            } else {
188
-                return 'http://' . (self::instance()->is_live ? '' : 'dev.') . $site . '.jacobemerick.com/';
189
-            }
190
-        }
191
-        return '/';
192
-    }
182
+	public static function getRootURL($site = '')
183
+	{
184
+		if (strlen($site) > 0) {
185
+			if ($site == 'waterfalls' && self::instance()->is_live) {
186
+				return 'http://www.waterfallsofthekeweenaw.com/';
187
+			} else {
188
+				return 'http://' . (self::instance()->is_live ? '' : 'dev.') . $site . '.jacobemerick.com/';
189
+			}
190
+		}
191
+		return '/';
192
+	}
193 193
 
194 194
 }
195 195
\ No newline at end of file
Please login to merge, or discard this 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.
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 4 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@  discard block
 block discarded – undo
18 18
 		$this->headers['Bcc'] = "Jacob <{$config->admin_email}>";
19 19
 	}
20 20
 
21
+	/**
22
+	 * @param string $person
23
+	 */
21 24
 	public function setToAddress($email, $person = null)
22 25
 	{
23 26
 		if($person)
@@ -27,12 +30,18 @@  discard block
 block discarded – undo
27 30
 		return $this;
28 31
 	}
29 32
 
33
+	/**
34
+	 * @param string $subject
35
+	 */
30 36
 	public function setSubject($subject)
31 37
 	{
32 38
 		$this->subject = $subject;
33 39
 		return $this;
34 40
 	}
35 41
 
42
+	/**
43
+	 * @param string $message
44
+	 */
36 45
 	public function setMessage($message)
37 46
 	{
38 47
 		$this->message = $message;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 	public function __construct()
14 14
 	{
15
-        global $config;
15
+		global $config;
16 16
 		$this->headers['From'] = self::$FROM;
17 17
 		$this->headers['Reply-To'] = "Jacob <{$config->admin_email}>";
18 18
 		$this->headers['Bcc'] = "Jacob <{$config->admin_email}>";
Please login to merge, or discard this 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.
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.